diff --git a/new/build-request.jam b/new/build-request.jam index 78977e787..874b6000d 100644 --- a/new/build-request.jam +++ b/new/build-request.jam @@ -221,6 +221,36 @@ local rule convert-command-line-element ( e ) # Class which is responsible for adjusting properties for targets # which are both directly requested, and requested from other main # targets. +# +# Consider: +# +# exe a : a.cpp b ; +# lib b : b.cpp ; +# +# and build request is "bjam define=MACRO". When "b" is requested by "a", the +# build request does not include "MACRO", because is not propagated. +# But it would seem strange that "b" is not compiled with "define=MACRO". The +# property adjuster is the entity that adds free properties from direct build +# request when targets are requested from other main targets, like "b". + +# We've discussed this in past and agreed that as long as "b" is +# directly requested, "define=MACRO" should be in build properties. +# +# The rule implemented in property adjuster is: +# if main target is requested from another main target and base properties are +# subset of base properties of some directy requested property set, then free +# properties from that properties set are added. I.e. if build request is +# +# debug define=MACROS +# +# then "b" will be compiled with the macros only if it's compiled in debug +# variant. For example +# +# exe a : a.cpp b/release ; +# lib b : b.cpp ; +# +# will cause a release version of 'b' to be compiled and linked into 'a'. The +# release version will be compiled without "define=MACROS". rule directly-requested-properties-adjuster { import property-set ; diff --git a/v2/build/build-request.jam b/v2/build/build-request.jam index 78977e787..874b6000d 100644 --- a/v2/build/build-request.jam +++ b/v2/build/build-request.jam @@ -221,6 +221,36 @@ local rule convert-command-line-element ( e ) # Class which is responsible for adjusting properties for targets # which are both directly requested, and requested from other main # targets. +# +# Consider: +# +# exe a : a.cpp b ; +# lib b : b.cpp ; +# +# and build request is "bjam define=MACRO". When "b" is requested by "a", the +# build request does not include "MACRO", because is not propagated. +# But it would seem strange that "b" is not compiled with "define=MACRO". The +# property adjuster is the entity that adds free properties from direct build +# request when targets are requested from other main targets, like "b". + +# We've discussed this in past and agreed that as long as "b" is +# directly requested, "define=MACRO" should be in build properties. +# +# The rule implemented in property adjuster is: +# if main target is requested from another main target and base properties are +# subset of base properties of some directy requested property set, then free +# properties from that properties set are added. I.e. if build request is +# +# debug define=MACROS +# +# then "b" will be compiled with the macros only if it's compiled in debug +# variant. For example +# +# exe a : a.cpp b/release ; +# lib b : b.cpp ; +# +# will cause a release version of 'b' to be compiled and linked into 'a'. The +# release version will be compiled without "define=MACROS". rule directly-requested-properties-adjuster { import property-set ;