From 64cdf92a0d7875ff2fdef39fe6f67612e5800546 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 12 Jul 2010 15:11:13 +0000 Subject: [PATCH] Use toolset.requirements in targets.py [SVN r63927] --- src/build/targets.py | 7 +++---- src/build/toolset.py | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/build/targets.py b/src/build/targets.py index b147009d1..8d41ca352 100644 --- a/src/build/targets.py +++ b/src/build/targets.py @@ -77,7 +77,7 @@ import os.path import sys from b2.util.utility import * -import property, project, virtual_target, property_set, feature, generators +import property, project, virtual_target, property_set, feature, generators, toolset from virtual_target import Subvariant from b2.exceptions import * from b2.util.sequence import unique @@ -142,8 +142,7 @@ class TargetRegistry: main target 'project' is the project where the main taret is to be declared.""" - # FIXME: revive after toolset.requirements are ported. - #specification.append(toolset.requirements) + specification.extend(toolset.requirements()) requirements = property_set.refine_from_user_input( project.get("requirements"), specification, @@ -1252,7 +1251,7 @@ class TypedTarget (BasicTarget): # Are there any top-level generators for this type/property set. if not generators.find_viable_generators (self.type_, prop_set): - print "error: no generators were found for type '$(self.type)'" + print "error: no generators were found for type '" + self.type_ + "'" print "error: and the requested properties" print "error: make sure you've configured the needed tools" print "See http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html" diff --git a/src/build/toolset.py b/src/build/toolset.py index 8485f0afe..af2486a5a 100644 --- a/src/build/toolset.py +++ b/src/build/toolset.py @@ -10,7 +10,7 @@ """ Support for toolset definition. """ -import feature, property, generators +import feature, property, generators, property_set from b2.util.utility import * from b2.util import set @@ -369,6 +369,8 @@ def __add_flag (rule_or_module, variable_name, condition, values): __module_flags.setdefault(m, []).append(f) __flags.setdefault(rule_or_module, []).append(f) +__requirements = [] + def requirements(): """Return the list of global 'toolset requirements'. Those requirements will be automatically added to the requirements of any main target.""" @@ -380,9 +382,9 @@ def add_requirements(requirements): they were specified literally. For best results, all requirements added should be conditional or indirect conditional.""" - # FIXME: #if ! $(.ignore-requirements) #{ + print "XXXX", requirements __requirements.extend(requirements) #}