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. Supported platforms: ia64, x64, x86, x86_amd64, x86_ia64
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
Configuration Method bound to waflib.Configure.ConfigurationContext
Create a bat file to obtain the location of the libraries
Parameters: |
|
---|---|
Target : | ? |
Vcvars : | ? |
Returns: | the location of msvc, 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 |
---|
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
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
The default is to allow a static and a shared library having the same name in the same directory, the static one being prefixed by ‘lib’. If you feel that this is incorrect, just change the extension (issue #824):
bld.env.STLIB_ST = bld.env.SHLIB_ST = '%s.lib'
bld.stlib(..., name='libfoo')
bld.shlib(..., name='foo')
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 |
---|
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 before the functions of given name(s):
from waflib.TaskGen import feature, before
@feature('myfeature')
@before_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 |
---|
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.info
Wrap logging.warn
Wrap logging.errors, display the origin of the message when ‘-vv’ is set
Wrap logging.debug, the output is filtered for performance reasons
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
alias of cxxstlib
Features defined in this module: