Search code examples
c++gccboost-buildbjam

boost build: disable -Weffc++ per module


I use boost build for a large project that is divided into different subprojects. Here the jamroot file:

project
    : requirements
    <variant>debug:<define>DEBUG
    <variant>release:<define>NDEBUG
    <variant>debug:<cxxflags>-Weffc++
    <include>.
    :
    ;

use-project ...
use-project ...
...

build-project ...
build-project ...
...

One subproject includes automatically generated code that isn't that good in code style. So I would like to disable tie -Weffc++ directive for this subproject. Declaring -Weffc++ per subproject is possible but I don't really like this solution, because I want to have -Weffc++ everywhere BUT in the (really few) subprojects I disable it.

Is there a possibility in boost build to disable this directive per subproject? Or is there a gcc compiler option I can add with another in the subproject and that will disable the already specified -Weffc++ ?


Solution

  • You can negate any Gcc warning option with the no- prefix: g++ -Wno-effc++. Define that for the subprojects you want to exclude, and it should work as long as subprojects' options are added to the command line after the defaults.