本文整理汇总了Python中b2.build.feature.feature函数的典型用法代码示例。如果您正苦于以下问题:Python feature函数的具体用法?Python feature怎么用?Python feature使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了feature函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __register_features
def __register_features():
""" Register features need by this module.
"""
# The feature is optional so that it is never implicitly added.
# It's used only for internal purposes, and in all cases we
# want to explicitly use it.
feature.feature("target-type", [], ["composite", "optional"])
feature.feature("main-target-type", [], ["optional", "incidental"])
feature.feature("base-target-type", [], ["composite", "optional", "free"])
示例2: __register_features
def __register_features ():
""" Register features need by this module.
"""
# The feature is optional so that it is never implicitly added.
# It's used only for internal purposes, and in all cases we
# want to explicitly use it.
feature.feature ('target-type', [], ['composite', 'optional'])
feature.feature ('main-target-type', [], ['optional', 'incidental'])
feature.feature ('base-target-type', [], ['composite', 'optional', 'free'])
示例3: init
from b2.manager import get_manager
from b2.util import stem, bjam_signature
from b2.util.sequence import unique
import bjam
import re
import os.path
import sys
def init():
pass
# Feature controling the command used to lanch test programs.
feature.feature("testing.launcher", [], ["free", "optional"])
feature.feature("test-info", [], ["free", "incidental"])
feature.feature("testing.arg", [], ["free", "incidental"])
feature.feature("testing.input-file", [], ["free", "dependency"])
feature.feature("preserve-test-targets", ["on", "off"], ["incidental", "propagated"])
# Register target types.
type.register("TEST", ["test"])
type.register("COMPILE", [], "TEST")
type.register("COMPILE_FAIL", [], "TEST")
type.register("RUN_OUTPUT", ["run"])
type.register("RUN", [], "TEST")
type.register("RUN_FAIL", [], "TEST")
示例4: header
# Add cpp-pch to sources:
#
# exe hello
# : main.cpp hello.cpp mypch
# ;
from b2.build import type, feature, generators
from b2.tools import builtin
type.register('PCH', ['pch'])
type.register('C_PCH', [], 'PCH')
type.register('CPP_PCH', [], 'PCH')
# Control precompiled header (PCH) generation.
feature.feature('pch',
['on', 'off'],
['propagated'])
feature.feature('pch-header', [], ['free', 'dependency'])
feature.feature('pch-file', [], ['free', 'dependency'])
class PchGenerator(generators.Generator):
"""
Base PCH generator. The 'run' method has the logic to prevent this generator
from being run unless it's being used for a top-level PCH target.
"""
def action_class(self):
return builtin.CompileAction
def run(self, project, name, prop_set, sources):
if not name:
示例5: register_globals
def register_globals ():
""" Registers all features and variants declared by this module.
"""
# This feature is used to determine which OS we're on.
# In future, this may become <target-os> and <host-os>
# TODO: check this. Compatibility with bjam names? Subfeature for version?
os = sys.platform
feature.feature ('os', [os], ['propagated', 'link-incompatible'])
# The two OS features define a known set of abstract OS names. The host-os is
# the OS under which bjam is running. Even though this should really be a fixed
# property we need to list all the values to prevent unknown value errors. Both
# set the default value to the current OS to account for the default use case of
# building on the target OS.
feature.feature('host-os', __os_names)
feature.set_default('host-os', default_host_os())
feature.feature('target-os', __os_names, ['propagated', 'link-incompatible'])
feature.set_default('target-os', default_host_os())
feature.feature ('toolset', [], ['implicit', 'propagated' ,'symmetric'])
feature.feature ('stdlib', ['native'], ['propagated', 'composite'])
feature.feature ('link', ['shared', 'static'], ['propagated'])
feature.feature ('runtime-link', ['shared', 'static'], ['propagated'])
feature.feature ('runtime-debugging', ['on', 'off'], ['propagated'])
feature.feature ('optimization', ['off', 'speed', 'space'], ['propagated'])
feature.feature ('profiling', ['off', 'on'], ['propagated'])
feature.feature ('inlining', ['off', 'on', 'full'], ['propagated'])
feature.feature ('threading', ['single', 'multi'], ['propagated'])
feature.feature ('rtti', ['on', 'off'], ['propagated'])
feature.feature ('exception-handling', ['on', 'off'], ['propagated'])
# Whether there is support for asynchronous EH (e.g. catching SEGVs).
feature.feature ('asynch-exceptions', ['on', 'off'], ['propagated'])
# Whether all extern "C" functions are considered nothrow by default.
feature.feature ('extern-c-nothrow', ['off', 'on'], ['propagated'])
feature.feature ('debug-symbols', ['on', 'off'], ['propagated'])
feature.feature ('define', [], ['free'])
feature.feature ('undef', [], ['free'])
feature.feature ('include', [], ['free', 'path']) #order-sensitive
feature.feature ('cflags', [], ['free'])
feature.feature ('cxxflags', [], ['free'])
feature.feature ('asmflags', [], ['free'])
feature.feature ('linkflags', [], ['free'])
feature.feature ('archiveflags', [], ['free'])
feature.feature ('version', [], ['free'])
feature.feature ('location-prefix', [], ['free'])
feature.feature ('action', [], ['free'])
# The following features are incidental, since
# in themself they have no effect on build products.
# Not making them incidental will result in problems in corner
# cases, for example:
#
# unit-test a : a.cpp : <use>b ;
# lib b : a.cpp b ;
#
# Here, if <use> is not incidental, we'll decide we have two
# targets for a.obj with different properties, and will complain.
#
# Note that making feature incidental does not mean it's ignored. It may
# be ignored when creating the virtual target, but the rest of build process
# will use them.
feature.feature ('use', [], ['free', 'dependency', 'incidental'])
feature.feature ('dependency', [], ['free', 'dependency', 'incidental'])
feature.feature ('implicit-dependency', [], ['free', 'dependency', 'incidental'])
feature.feature('warnings', [
'on', # Enable default/"reasonable" warning level for the tool.
'all', # Enable all possible warnings issued by the tool.
'off'], # Disable all warnings issued by the tool.
['incidental', 'propagated'])
feature.feature('warnings-as-errors', [
'off', # Do not fail the compilation if there are warnings.
'on'], # Fail the compilation if there are warnings.
['incidental', 'propagated'])
feature.feature('c++-template-depth',
[str(i) for i in range(64,1024+1,64)] +
[str(i) for i in range(20,1000+1,10)] +
# Maximum template instantiation depth guaranteed for ANSI/ISO C++
# conforming programs.
['17'],
['incidental', 'optional', 'propagated'])
feature.feature ('source', [], ['free', 'dependency', 'incidental'])
feature.feature ('library', [], ['free', 'dependency', 'incidental'])
#.........这里部分代码省略.........
示例6: PropertyMeta
from b2.build import feature
from b2.util import sequence, qualify_jam_action, is_iterable_typed
import b2.util.set
from b2.manager import get_manager
__re_two_ampersands = re.compile ('&&')
__re_comma = re.compile (',')
__re_split_condition = re.compile ('(.*):(<.*)')
__re_split_conditional = re.compile (r'(.+):<(.+)')
__re_colon = re.compile (':')
__re_has_condition = re.compile (r':<')
__re_separate_condition_and_property = re.compile (r'(.*):(<.*)')
_not_applicable_feature='not-applicable-in-this-context'
feature.feature(_not_applicable_feature, [], ['free'])
__abbreviated_paths = False
class PropertyMeta(type):
"""
This class exists to implement the isinstance() and issubclass()
hooks for the Property class. Since we've introduce the concept of
a LazyProperty, isinstance(p, Property) will fail when p is a LazyProperty.
Implementing both __instancecheck__ and __subclasscheck__ will allow
LazyProperty instances to pass the isinstance() and issubclass check for
the Property class.
Additionally, the __call__ method intercepts the call to the Property
constructor to ensure that calling Property with the same arguments
示例7: get_manager
bjam.call('DEPENDS', [target], imported_tlbs)
bjam.call('NOCARE', all + imported_tlbs)
engine.set_target_variable(included_angle , 'SEARCH', [utility.get_value(inc) for inc in self.includes])
engine.set_target_variable(included_quoted, 'SEARCH', [utility.get_value(inc) for inc in self.includes])
engine.set_target_variable(imported , 'SEARCH', [utility.get_value(inc) for inc in self.includes])
engine.set_target_variable(imported_tlbs , 'SEARCH', [utility.get_value(inc) for inc in self.includes])
get_manager().scanners().propagate(type.get_scanner('CPP', PropertySet(self.includes)), included_angle + included_quoted)
get_manager().scanners().propagate(self, imported)
scanner.register(MidlScanner, 'include')
type.set_scanner('IDL', MidlScanner)
# Command line options
feature('midl-stubless-proxy', ['yes', 'no'], ['propagated'] )
feature('midl-robust', ['yes', 'no'], ['propagated'] )
flags('midl.compile.idl', 'MIDLFLAGS', ['<midl-stubless-proxy>yes'], ['/Oicf' ])
flags('midl.compile.idl', 'MIDLFLAGS', ['<midl-stubless-proxy>no' ], ['/Oic' ])
flags('midl.compile.idl', 'MIDLFLAGS', ['<midl-robust>yes' ], ['/robust' ])
flags('midl.compile.idl', 'MIDLFLAGS', ['<midl-robust>no' ], ['/no_robust'])
# Architecture-specific options
architecture_x86 = ['<architecture>' , '<architecture>x86']
address_model_32 = ['<address-model>', '<address-model>32']
address_model_64 = ['<address-model>', '<address-model>64']
flags('midl.compile.idl', 'MIDLFLAGS', [ar + '/' + m for ar in architecture_x86 for m in address_model_32 ], ['/win32'])
flags('midl.compile.idl', 'MIDLFLAGS', [ar + '/<address-model>64' for ar in architecture_x86], ['/x64'])
flags('midl.compile.idl', 'MIDLFLAGS', ['<architecture>ia64/' + m for m in address_model_64], ['/ia64'])
示例8: install
import b2.build.feature as feature
import b2.build.property as property
import b2.util.option as option
import b2.tools.stage as stage
from b2.build.alias import alias
from b2.manager import get_manager
from b2.util import bjam_signature
from b2.util.utility import ungrist
import os
feature.feature("install-default-prefix", [], ["free", "incidental"])
@bjam_signature((["name", "package_name", "?"], ["requirements", "*"],
["binaries", "*"], ["libraries", "*"], ["headers", "*"]))
def install(name, package_name=None, requirements=[], binaries=[], libraries=[], headers=[]):
requirements = requirements[:]
binaries = binaries[:]
libraries
if not package_name:
package_name = name
if option.get("prefix"):
# If --prefix is explicitly specified on the command line,
# then we need wipe away any settings of libdir/includir that
示例9:
condition = common.check_init_parameters ('darwin', None, ('version', version))
command = common.get_invocation_command ('darwin', 'g++', command)
common.handle_options ('darwin', condition, command, options)
gcc.init_link_flags ('darwin', 'darwin', condition)
# Darwin has a different shared library suffix
type.set_generated_target_suffix ('SHARED_LIB', ['<toolset>darwin'], 'dylib')
# we need to be able to tell the type of .dylib files
type.register_suffixes ('dylib', 'SHARED_LIB')
feature.feature ('framework', [], ['free'])
toolset.flags ('darwin.compile', 'OPTIONS', '<link>shared', ['-dynamic'])
toolset.flags ('darwin.compile', 'OPTIONS', None, ['-Wno-long-double', '-no-cpp-precomp'])
toolset.flags ('darwin.compile.c++', 'OPTIONS', None, ['-fcoalesce-templates'])
toolset.flags ('darwin.link', 'FRAMEWORK', '<framework>')
# This is flag is useful for debugging the link step
# uncomment to see what libtool is doing under the hood
# toolset.flags ('darwin.link.dll', 'OPTIONS', None, '[-Wl,-v'])
action.register ('darwin.compile.cpp', None, ['$(CONFIG_COMMAND) $(ST_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) $(OPTIONS)'])
# TODO: how to set 'bind LIBRARIES'?
action.register ('darwin.link.dll', None, ['$(CONFIG_COMMAND) -dynamiclib -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) $(OPTIONS)'])
示例10: header
# ;
#
# Add cpp-pch to sources:
#
# exe hello
# : main.cpp hello.cpp mypch
# ;
from b2.build import type, feature, generators
type.register("PCH", ["pch"])
type.register("C_PCH", [], "PCH")
type.register("CPP_PCH", [], "PCH")
# Control precompiled header (PCH) generation.
feature.feature("pch", ["on", "off"], ["propagated"])
feature.feature("pch-header", [], ["free", "dependency"])
feature.feature("pch-file", [], ["free", "dependency"])
class PchGenerator(generators.Generator):
"""
Base PCH generator. The 'run' method has the logic to prevent this generator
from being run unless it's being used for a top-level PCH target.
"""
def action_class(self):
return "compile-action"
def run(self, project, name, prop_set, sources):
示例11: get_manager
engine.set_target_variable(included_quoted, "SEARCH", [utility.get_value(inc) for inc in self.includes])
engine.set_target_variable(imported, "SEARCH", [utility.get_value(inc) for inc in self.includes])
engine.set_target_variable(imported_tlbs, "SEARCH", [utility.get_value(inc) for inc in self.includes])
get_manager().scanners().propagate(
type.get_scanner("CPP", PropertySet(self.includes)), included_angle + included_quoted
)
get_manager().scanners().propagate(self, imported)
scanner.register(MidlScanner, "include")
type.set_scanner("IDL", MidlScanner)
# Command line options
feature("midl-stubless-proxy", ["yes", "no"], ["propagated"])
feature("midl-robust", ["yes", "no"], ["propagated"])
flags("midl.compile.idl", "MIDLFLAGS", ["<midl-stubless-proxy>yes"], ["/Oicf"])
flags("midl.compile.idl", "MIDLFLAGS", ["<midl-stubless-proxy>no"], ["/Oic"])
flags("midl.compile.idl", "MIDLFLAGS", ["<midl-robust>yes"], ["/robust"])
flags("midl.compile.idl", "MIDLFLAGS", ["<midl-robust>no"], ["/no_robust"])
# Architecture-specific options
architecture_x86 = ["<architecture>", "<architecture>x86"]
address_model_32 = ["<address-model>", "<address-model>32"]
address_model_64 = ["<address-model>", "<address-model>64"]
flags("midl.compile.idl", "MIDLFLAGS", [ar + "/" + m for ar in architecture_x86 for m in address_model_32], ["/win32"])
flags("midl.compile.idl", "MIDLFLAGS", [ar + "/<address-model>64" for ar in architecture_x86], ["/x64"])
flags("midl.compile.idl", "MIDLFLAGS", ["<architecture>ia64/" + m for m in address_model_64], ["/ia64"])
示例12: InstallTargetClass
import b2.build.property as property
import b2.build.property_set as property_set
import b2.build.generators as generators
import b2.build.virtual_target as virtual_target
from b2.manager import get_manager
from b2.util.sequence import unique
from b2.util import bjam_signature
import b2.build.type
import os.path
import re
import types
feature.feature("install-dependencies", ["off", "on"], ["incidental"])
feature.feature("install-type", [], ["free", "incidental"])
feature.feature("install-source-root", [], ["free", "path"])
feature.feature("so-version", [], ["free", "incidental"])
# If 'on', version symlinks for shared libraries will not be created. Affects
# Unix builds only.
feature.feature("install-no-version-symlinks", ["on"], ["optional", "incidental"])
class InstallTargetClass(targets.BasicTarget):
def update_location(self, ps):
"""If <location> is not set, sets it based on the project data."""
loc = ps.get("location")
if not loc:
示例13: debug
# Note that the requirements are automatically transformed into suitable
# tags to find the correct pre-built library.
#
import re
import bjam
from b2.build import alias, property, property_set, feature
from b2.manager import get_manager
from b2.tools import builtin, common
from b2.util import bjam_signature, regex
# TODO: This is currently necessary in Python Port, but was not in Jam.
feature.feature('layout', ['system', 'versioned', 'tag'], ['optional'])
feature.feature('root', [], ['optional', 'free'])
feature.feature('build-id', [], ['optional', 'free'])
__initialized = None
__boost_auto_config = property_set.create([property.Property('layout', 'system')])
__boost_configured = {}
__boost_default = None
__build_id = None
__debug = None
def debug():
global __debug
if __debug is None:
__debug = "--debug-configuration" in bjam.variable("ARGV")
示例14: init
import bjam
from b2.tools import common, rc
from b2.build import generators, type
from b2.build.toolset import flags
from b2.build.feature import feature
from b2.manager import get_manager
def init():
pass
type.register('MC', ['mc'])
# Command line options
feature('mc-input-encoding', ['ansi', 'unicode'], ['free'])
feature('mc-output-encoding', ['unicode', 'ansi'], ['free'])
feature('mc-set-customer-bit', ['no', 'yes'], ['free'])
flags('mc.compile', 'MCFLAGS', ['<mc-input-encoding>ansi'], ['-a'])
flags('mc.compile', 'MCFLAGS', ['<mc-input-encoding>unicode'], ['-u'])
flags('mc.compile', 'MCFLAGS', ['<mc-output-encoding>ansi'], '-A')
flags('mc.compile', 'MCFLAGS', ['<mc-output-encoding>unicode'], ['-U'])
flags('mc.compile', 'MCFLAGS', ['<mc-set-customer-bit>no'], [])
flags('mc.compile', 'MCFLAGS', ['<mc-set-customer-bit>yes'], ['-c'])
generators.register_standard('mc.compile', ['MC'], ['H', 'RC'])
get_manager().engine().register_action(
'mc.compile',
'mc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)"')
示例15: debug
# Note that the requirements are automatically transformed into suitable
# tags to find the correct pre-built library.
#
import re
import bjam
from b2.build import alias, property, property_set, feature
from b2.manager import get_manager
from b2.tools import builtin, common
from b2.util import bjam_signature, regex
# TODO: This is currently necessary in Python Port, but was not in Jam.
feature.feature("layout", ["system", "versioned", "tag"], ["optional"])
feature.feature("root", [], ["optional", "free"])
feature.feature("build-id", [], ["optional", "free"])
__initialized = None
__boost_auto_config = property_set.create([property.Property("layout", "system")])
__boost_configured = {}
__boost_default = None
__build_id = None
__debug = None
def debug():
global __debug
if __debug is None: