|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64293 - trunk/tools/build/v2/build
From: ghost_at_[hidden]
Date: 2010-07-23 07:32:45
Author: vladimir_prus
Date: 2010-07-23 07:32:44 EDT (Fri, 23 Jul 2010)
New Revision: 64293
URL: http://svn.boost.org/trac/boost/changeset/64293
Log:
Add helper targets.metatarget_function_for_class.
Text files modified:
trunk/tools/build/v2/build/targets.py | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
Modified: trunk/tools/build/v2/build/targets.py
==============================================================================
--- trunk/tools/build/v2/build/targets.py (original)
+++ trunk/tools/build/v2/build/targets.py 2010-07-23 07:32:44 EDT (Fri, 23 Jul 2010)
@@ -81,7 +81,7 @@
from virtual_target import Subvariant
from b2.exceptions import *
from b2.util.sequence import unique
-from b2.util import set, path
+from b2.util import set, path, bjam_signature
from b2.build.errors import user_error_checkpoint
_re_separate_target_from_properties = re.compile (r'^([^<]*)(/(<.*))?$')
@@ -1261,3 +1261,22 @@
return r
+def metatarget_function_for_class(class_):
+
+ @bjam_signature((["name"], ["sources", "*"], ["requirements", "*"],
+ ["default_build", "*"], ["usage_requirements", "*"]))
+ def create_metatarget(name, sources, requirements = [], default_build = None, usage_requirements = []):
+
+ from b2.manager import get_manager
+ t = get_manager().targets()
+
+ project = get_manager().projects().current()
+
+ return t.main_target_alternative(
+ class_(name, project,
+ t.main_target_sources(sources, name),
+ t.main_target_requirements(requirements, project),
+ t.main_target_default_build(default_build, project),
+ t.main_target_usage_requirements(usage_requirements, project)))
+
+ return create_metatarget
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk