From 9c65d5b982f8a42e5160d1395274de7396d8fa5d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 18 Nov 2006 18:34:42 +0000 Subject: [PATCH] Introduce 'toolset requirements' [SVN r36076] --- src/build/targets.jam | 3 +++ src/build/toolset.jam | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/build/targets.jam b/src/build/targets.jam index 23962a258..8a1fbd632 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -82,6 +82,7 @@ import path ; import set ; import assert ; import indirect ; +import toolset ; # Base class for all abstract targets. class abstract-target @@ -1408,6 +1409,8 @@ rule main-target-requirements ( : project # Project where the main target is to be declared ) { + specification += [ toolset.requirements ] ; + local requirements = [ property-set.refine-from-user-input [ $(project).get requirements ] : $(specification) : [ $(project).project-module ] : [ $(project).get location ] ] ; diff --git a/src/build/toolset.jam b/src/build/toolset.jam index 95996af6f..36c0a21da 100644 --- a/src/build/toolset.jam +++ b/src/build/toolset.jam @@ -465,7 +465,23 @@ rule inherit-rules ( toolset : base ) IMPORT $(toolset) : $(rules) : : $(toolset).$(rules) ; } +# Return the list of global 'toolset requirements'. +# Those requirements will be automatically added to +# the requirements of any main target. +rule requirements ( ) +{ + return $(.requirements) ; +} +# Adds elements to the list of global 'toolset requirements'. +# The requirements will be automatically added to the requirements +# for all main targets, as if they were specified literally. +# For best results, all requirements added should be conditional or +# indirect conditional. +rule add-requirements ( requirements * ) +{ + .requirements += $(requirements) ; +} local rule __test__ ( ) {