Boost logo

Boost-Build :

Subject: Re: [Boost-build] How best to combine "using xxx", toolset invocation, and conditions?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-12-24 11:25:16


AMDG

On 12/24/2013 03:54 AM, Jess Peterson wrote:
> Thank you for the explanation. There is a bug in gcc.jam, since if I have
> a project-config.jam file with:
>
> using gcc ;
> using gcc : mingw : /opt/mxe/usr/bin/i686-pc-mingw32-g++ ;
>
> and a Jamroot with:
>
> exe hello : hello.cpp ;
>
> and invoke with "b2 toolset=gcc-mingw", then I get both compilers added to
> CONFIG_COMMAND
>
> "g++" "/opt/mxe/usr/bin/i686-pc-mingw32-g++" -o
> "bin/gcc-mingw-4.4.7/debug/hello" -Wl,--start-group -Wl,--start-group
> "bin/gcc-mingw-4.4.7/debug/hello.o" -Wl,-Bstatic -Wl,-Bstatic
> -Wl,-Bdynamic -Wl,-Bdynamic -Wl,--end-group -Wl,--end-group -g
>
> It turns out that choosing "mingw" as my toolset version was not a
> fortunate choice since there is special treatment in gcc.jam that sets the
> flavor to mingw if the target machine has a mingw in it. Any other name
> works as expected.
>
> Flavor is not used to find a toolset so toolset=gcc-mingw does not work no
> matter what is chosen as a version. Also flavor adds a tag at the end of
> the condition (<toolset>gcc-version-flavor) and produces a build at
> .../gcc-flavor-version/... so it is a little confusing.
>

The order of subfeatures doesn't matter.
Boost.Build sorts them alphabetically.

> ---------------------------
>
> As an aside, when I made my little test case above, I first put the using
> lines in the Jamroot and invoked with --ignore-config. The first thing
> that happened is that it found a project-config.jam from a directory far
> above my little test directory, so I added an empty project-config.jam.
> The next thing is that the using lines are ignored if they are in the
> Jamroot file. I am not sure why this happens, but I moved the using lines
> to the local project-config.jam.
>
> Shouldn't using Jamroot, instead of Jamfile, make the current directory the
> root of the project so b2 should not look higher for a project-config.jam?
>

Yes.

> Shouldn't --ignore-config make it not look for a project-config.jam as well
> as site-config.jam and user-config.jam?
>

Yes.

> Is there any documentation on project-config.jam and what it normally
> contains?
>

It's no different from user-config.jam, except that it's
intended to be local to the project.

In Christ,
Steven Watanabe


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