Boost logo

Boost-Build :

Subject: Re: [Boost-build] Order of command line parameters
From: Ben Pope (benpope81_at_[hidden])
Date: 2015-06-01 07:59:52


On Monday, June 01, 2015 02:32 PM, Gevorg Voskanyan wrote:
> On 06/01/15 03:41, Edward Diener wrote:
>> Is there any way to change the order of command line parameters when a
>> compiler is invokded ? For many if not most compilers the order of
>> command line parameters is significant. If in my user-config.jam file
>> I place a toolset command for a compiler, and specify one or more
>> <cxxflags> the flags evidently are output on the command line in some
>> sort of random order amongs other command line parameters generated by
>> jam files from within Boost. But suppose I want my user-config.jam
>> command line parameters to come first or last in the order of command
>> line parameters. is there any way to accomplish that ? if not I
>> suggest there should be.
>
> I second this. If for example I have
>
> using clang : : : <cxxflags>"-Wno-logical-op-parentheses" ;
>
> then whenever a project is built with <warnings>on or <warnings>all,
> -Wall is appended to the command line after the flags in user-config,
> making -Wno-logical-op-parentheses to lose its effect. If there was a
> way to specify that a certain flag should come near the end of the
> command line rather than near the beginning, that would solve my case.

If you specify it on the command line it seems to go in front of and
behind the rest of the commands (perhaps some toolchains work the other
way around). I haven't investigated, but I feel the priority is
toolchain in user-config overriden by project jam, then overridden by
the command line. I don't know where site-config sits, presumably with
the lowest precedence.

Try something like:
./b2 -cxxflags="-Wno-logical-op-parentheses" ...

Ben


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