mirror of https://gitlab.com/ita1024/waf.git
docs
This commit is contained in:
parent
cdb339213b
commit
31c3ccda27
|
@ -11,12 +11,12 @@ out = 'build'
|
||||||
"""
|
"""
|
||||||
Variant system for waf 1.6
|
Variant system for waf 1.6
|
||||||
|
|
||||||
call for example
|
Call for example:
|
||||||
$ waf configure build_debug build_release clean_debug clean_release
|
$ waf configure build_debug build_release clean_debug clean_release
|
||||||
"""
|
|
||||||
|
|
||||||
def options(opt):
|
The builds will end in different build folders
|
||||||
opt.load('compiler_c')
|
note how "bld.variant" is used to detect the current variant
|
||||||
|
"""
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
|
|
||||||
|
@ -57,11 +57,8 @@ def build(bld):
|
||||||
# * add an 'env' parameter to a particular task generator:
|
# * add an 'env' parameter to a particular task generator:
|
||||||
# bld.program(..., env=bld.all_envs['release'].derive())
|
# bld.program(..., env=bld.all_envs['release'].derive())
|
||||||
|
|
||||||
# ------ new declaration for variants -------
|
def options(opt):
|
||||||
#
|
opt.load('compiler_c')
|
||||||
# calling 'waf clean_debug debug' will build into another output directory
|
|
||||||
# note how "bld.variant" is used to detect the current variant
|
|
||||||
#
|
|
||||||
|
|
||||||
def init(ctx):
|
def init(ctx):
|
||||||
from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext
|
from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext
|
||||||
|
@ -87,3 +84,27 @@ def init(ctx):
|
||||||
# the commands will be "build_win32/debug" or "build_win32/release"
|
# the commands will be "build_win32/debug" or "build_win32/release"
|
||||||
# in this case you may want to modify Options.commands in this "init" function
|
# in this case you may want to modify Options.commands in this "init" function
|
||||||
|
|
||||||
|
# --------------------------
|
||||||
|
# or, if you want to memorize the default variant and just type "waf",
|
||||||
|
#
|
||||||
|
#def options(opt):
|
||||||
|
# opt.load('compiler_c')
|
||||||
|
#def init(ctx):
|
||||||
|
# from waflib import ConfigSet, Options
|
||||||
|
# env = ConfigSet.ConfigSet()
|
||||||
|
# try:
|
||||||
|
# env.load('build/c4che/foo.txt')
|
||||||
|
# except:
|
||||||
|
# the_variant = 'debug'
|
||||||
|
# else:
|
||||||
|
# the_variant = env.the_variant or debug
|
||||||
|
#
|
||||||
|
# if getattr(Options.options, 'the_variant', ''):
|
||||||
|
# if Options.options.the_variant != the_variant:
|
||||||
|
# the_variant = env.the_variant = Options.options.the_variant
|
||||||
|
# env.store('build/c4che/foo.txt')
|
||||||
|
#
|
||||||
|
# for y in (BuildContext, CleanContext, InstallContext, UninstallContext):
|
||||||
|
# class tmp(y):
|
||||||
|
# variant = the_variant
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue