tags:

views:

352

answers:

1

I need to add to compiler flags using bjam. So either I need a way to append to the existing flags -- like CXXFLAGS+=whatever using gmake -- or I need to know the currently-used value of cxxflags so I can replace it with my additions.

As usual, the documentation leaves me astonished at the complexity of bjam but no closer to being able to do anything useful with it.

+1  A: 

If you are only looking to do this on the command line you can add flags by specifying "feature=value" arguments. In the case of the make CXXFLAGS the corresponding would be "cxxflags=--some-option". Refer to the Boost Build docs section on built-in features for other such possible features to use. If you are using Boost Build as your build system, and hence need to specify them in your Jamfiles, then you need to add requirements to you project and/or targets (see BB projects and BBv2 targets).

GrafikRobot
Thanks. Related question -- I want to override a feature which is part of the project "requirements". In particular, in the requirements there is <warnings>offI want to build with warnings=on. Putting this on the command line does nothing because the requirements take precedence over the command line. How can I make warnings=off be the default yet allow a way to override it?
c-urchin
You need to make that a default build option instead of a requirement. Then you can override it when building, either in the command line or when used from some other out-of-project targets.
GrafikRobot