how to determine value of cxxflags in bjam? Or append to it?
Asked Answered
F

1

7

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.

Femoral answered 27/4, 2010 at 15:16 Comment(0)
B
4

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).

Bois answered 27/4, 2010 at 15:37 Comment(2)
Thanks. Related question -- I want to override a feature which is part of the project "requirements". In particular, in the requirements there is <warnings>off I 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?Femoral
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.Bois

© 2022 - 2024 — McMap. All rights reserved.