Microsoft Visual C++/Intel C++ compiler support
Usage:
$ waf configure --msvc_version="msvc 10.0,msvc 9.0" --msvc_target="x64"
or:
def configure(conf):
conf.env['MSVC_VERSIONS'] = ['msvc 10.0', 'msvc 9.0', 'msvc 8.0', 'msvc 7.1', 'msvc 7.0', 'msvc 6.0', 'wsdk 7.0', 'intel 11', 'PocketPC 9.0', 'Smartphone 8.0']
conf.env['MSVC_TARGETS'] = ['x64']
conf.load('msvc')
or:
def configure(conf):
conf.load('msvc', funs='no_autodetect')
conf.check_lib_msvc('gdi32')
conf.check_libs_msvc('kernel32 user32')
def build(bld):
tg = bld.program(source='main.c', target='app', use='KERNEL32 USER32 GDI32')
Platforms and targets will be tested in the order they appear; the first good configuration will be used.
To skip testing all the configurations that are not used, use the --msvc_lazy_autodetect option or set conf.env['MSVC_LAZY_AUTODETECT']=True.
Supported platforms: ia64, x64, x86, x86_amd64, x86_ia64, x86_arm, amd64_x86, amd64_arm
Compilers supported:
To use WAF in a VS2008 Make file project (see http://code.google.com/p/waf/issues/detail?id=894) You may consider to set the environment variable “VS_UNICODE_OUTPUT” to nothing before calling waf. So in your project settings use something like ‘cmd.exe /C “set VS_UNICODE_OUTPUT=& set PYTHONUNBUFFERED=true & waf build”’. cmd.exe /C “chcp 1252 & set PYTHONUNBUFFERED=true && set && waf configure” Setting PYTHONUNBUFFERED gives the unbuffered output.
importlibs provided by MSVC/Platform SDK. Do NOT search them
List of msvc platforms
List of wince platforms
List of icl platforms
Checks installed compilers and targets and returns the first combination from the user’s options, env, or the global supported lists that checks.
Parameters: |
|
---|---|
Returns: | the compiler, revision, path, include dirs, library paths, and (optionally) target architecture |
Return type: | tuple of strings |
Configuration Method bound to waflib.Configure.ConfigurationContext
Checks that an installed compiler actually runs and uses vcvars to obtain the environment needed by the compiler.
Parameters: |
|
---|---|
Returns: | the location of the compiler executable, the location of include dirs, and the library paths |
Return type: | tuple of strings |
Configuration Method bound to waflib.Configure.ConfigurationContext
Use winreg to add the msvc versions to the input list
Parameters: | versions (list) – list to modify |
---|
Checks SmartPhones SDKs
Parameters: | versions (list) – list to modify |
---|
Gets the compiler environment variables as a tuple. Evaluation is eager by default. If set to lazy with --msvc_lazy_autodetect or env.MSVC_LAZY_AUTODETECT the environment is evaluated when the tuple is destructured or iterated. This means destructuring can throw conf.errors.ConfigurationError.
Parameters: |
|
---|
Bases: object
A tuple that evaluates its elements from a function when iterated or destructured.
Parameters: |
|
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext
Checks ICL compilers
Parameters: | versions (list) – list to modify |
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Checks ICL compilers that are part of Intel Composer Suites
Parameters: | versions (list) – list to modify |
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Returns: | list of compilers installed |
---|---|
Return type: | list of string |
Configuration Method bound to waflib.Configure.ConfigurationContext
Print the contents of conf.env.MSVC_INSTALLED_VERSIONS
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext
Win32/MSVC specific code to glean out information from libtool la files. this function is not attached to the task_gen class
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext
Ideally we should be able to place the lib in the right env var, either STLIB or LIB, but we don’t distinguish static libs from shared libs. This is ok since msvc doesn’t have any special linker flag to select static libs (no env[‘STLIB_MARKER’])
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext
Configuration Method bound to waflib.Configure.ConfigurationContext Due to path format limitations, limit operation only to native Win32. Yeah it sucks.
Configuration Method bound to waflib.Configure.ConfigurationContext visual studio flags found in the system environment
Configuration Method bound to waflib.Configure.ConfigurationContext
Setup the flags required for executing the msvc compiler
Task generator method
Add additional flags implied by msvc, such as subsystems and pdb files:
def build(bld):
bld.stlib(source='main.c', target='bar', subsystem='gruik')
Feature : | c, cxx |
---|
Task generator method
Special linker for MSVC with support for embedding manifests into DLL’s and executables compiled by Visual Studio 2005 or probably later. Without the manifest file, the binaries are unusable. See: http://msdn2.microsoft.com/en-us/library/ms235542(VS.80).aspx
Feature : | cprogram, cshlib, cxxprogram, cxxshlib |
---|
Change the command-line execution for msvc programs. Instead of quoting all the paths and keep using the shell, we can just join the options msvc is interested in
Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.Configure.ConfigurationContext. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:
def configure(conf):
conf.find_program('abc', mandatory=False)
Parameters: | f (function) – method to bind |
---|
Decorator: register a task generator method that will be executed when the object attribute ‘feature’ contains the corresponding key(s):
from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
print('that is my feature!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – feature names |
---|
Decorator: register a task generator method which will be executed after the functions of given name(s):
from waflib.TaskGen import feature, after
@feature('myfeature')
@after_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Wrap logging.warn
Wrap logging.debug, the output is filtered for performance reasons
Manifest file processing and @response file workaround for command-line length limits on Windows systems The indicated task class is replaced by a subclass to prevent conflicts in case the class is wrapped more than once
Task generator method
Insert configuration flags for windows phone applications (adds /ZW, /TP...)
Feature : | winphoneapp |
---|
Task generator method
Insert configuration flags for windows applications (adds /ZW, /TP...)
Feature : | winapp |
---|
Features defined in this module: