Boost logo

Boost-Build :

From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2008-09-01 11:40:54


   Hi João.

> I'm having two problems with setting alternatives based on toolsets in
> a multi-platform and toolset project with:
>
> Boost.Build V2 (Milestone 12)
> Boost.Jam 03.1.16
>
> The first problem is that, with Jamfile.jam such as:
>
> lib system_monitor
> : src/processlistwindows.cxx
> : <define>MYDEF
> : <toolset>msvc
> ;
>
> lib system_monitor
> : src/processlistlinux.cxx
> : <define>MYDEF
> : <toolset>gcc
> ;
>
> I get the following error running 'bjam -q --toolset=gcc':
>
> ~/usr/share/boost-build/build/feature.jam:432: in
> feature.validate-value-string from module feature
> error: "msvc" is not a known value of feature <toolset>
> error: legal values: "gcc"

   I believe this version had an incorrectly placed property value
validation check when processing requirements and that this has since
been resolved in the trunk.

   Use the Boost Build version coming with Boost 1.36.0, the latest
nightly build (http://zigzag.lvk.cs.msu.su/~ghost/boost_build_nightly/
in case the official web site still has problems updating its nightly
build links) or the current trunk version. I would suggest using the
current nightly build.

   Also, if you do take the nightly build, build yourself a new bjam
executable as there have been several bugs fixed in it since it was last
released.

   I tried the following jamfile.jam with the current trunk version (on
Windows) and it works as expected:

> exe aaa : a.cpp : <toolset>woopsie <runtime-link>static ;
> exe aaa : a.cpp : <toolset>msvc <runtime-link>shared ;

   With a.cpp file containing just the 'int main() {}' function.

> The second problem is that I want to have certain libraries that are
> part of the project to be considered dependencies (and therefore
> built) only on certain platforms. I'm using <toolset> like this:
>
> alias source_list : platform_a_sourcelist : <toolset>msvc ;
>
> alias source_list ;
>
> lib mylib : source_list : <define>MYDEF ;
>
> But I am having no sucess.

   What do you mean by no success? I tried the following jamfile.jam:

> alias source-list : b.cpp : <toolset>msvc ;
> alias source-list ;
> exe aaa : a.cpp source-list ;

   With a.cpp file containing just the 'int main() {}' function and
b.cpp containing just a 'void f() {}' function.

   And it worked like a charm:

> C:\Documents and Settings\Jurko\BBTest>bjam gcc
> ...found 8 targets...
> ...updating 5 targets...
> MkDir1-quick-fix-for-windows bin
> MkDir1-quick-fix-for-windows bin\gcc-3.4.4
> MkDir1-quick-fix-for-windows bin\gcc-3.4.4\debug
> gcc.compile.c++ bin\gcc-3.4.4\debug\a.o
> gcc.link bin\gcc-3.4.4\debug\aaa.exe
> ...updated 5 targets...
>
> C:\Documents and Settings\Jurko\BBTest>bjam msvc
> ...found 12 targets...
> ...updating 6 targets...
> MkDir1-quick-fix-for-windows bin\msvc-9.0express
> MkDir1-quick-fix-for-windows bin\msvc-9.0express\debug
> MkDir1-quick-fix-for-windows bin\msvc-9.0express\debug\threading-multi
> compile-c-c++ bin\msvc-9.0express\debug\threading-multi\b.obj
> b.cpp
> compile-c-c++ bin\msvc-9.0express\debug\threading-multi\a.obj
> a.cpp
> msvc.link bin\msvc-9.0express\debug\threading-multi\aaa.exe
> ...updated 6 targets...

   As you can see from the output, when compiling with gcc it did not
compile the b.cpp file while it did so when compiling with msvc.

   This could possibly also be a bug due to an old Boost Build version
though.

   Hope this helps.

   Best regards,
     Jurko Gospodnetić


Boost-Build 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