In the boost build V2 documentation, it states

 

lib demangler : dummy_demangler.cpp ; # alternative 1

lib demangler : demangler_gcc.cpp : <toolset>gcc ; # alternative 2

lib demangler : demangler_msvc.cpp : <toolset>msvc ; # alternative 3

 

In the example above, whenever network is built with <link>shared, <define>NEWORK_LIB_SHARED will be in its properties,

too. Also, whenever its release variant is built, <define>EXTRA_FAST will appear in its properties.

 

I have a rule I would like bjam to call conditionally to build an imported library that uses SCONS, and have created a jamfile.jam for it :

 

project my_project : requirements <link>static ;

 

rule  build_scons ( cmplr : dbgflag )

{

    . . . (call the imported library’s SCONS makefile with $(cmplr) and $(dbgflag))

}

 

lib my_project : [ build_scons gcc : 0 ] : <toolset>gcc,<variant>release ;

lib my_project : [ build_scons gcc : 1 ] : <toolset>gcc,<variant>debug ;

lib my_project : [ build_scons icc : 0 ] : <toolset>intel,<variant>release ;

lib my_project : [ build_scons icc : 1 ] : <toolset>intel,<variant>debug ;

 

I have also added the following to the parent project’s jamroot.jam file:

 

build-project my_project ;

 

With a build command in the parent directory of

 

bjam gcc debug

 

I expected only the lib with <toolset>gcc,<variant>debug to be built.  But bjam builds all 4 versions of this lib, in the order listed by the 4 lib statements.  What do I need to do to get the conditional selection for the lib to work?  There is something basic I must have missed in the documentation.

 

                Ray Blackham