Skip to content

[cleanup][OverloadCompilerFlags] Move compiler flag overloading to user script.

Robert K requested to merge cleanup/overload-compiler-flags into master

Use the cmake compile launcher variable to provide CXX_FLAGS overwriting. The ALLOW_CXXFLAGS_OVERWRITE flag is removed.

Usage

Provide the following cmake flags

CMAKE_FLAGS="-DCMAKE_CXX_FLAGS="" -D`CMAKE_CXX_COMPILER_LAUNCHER=$PWD/compiler_launcher.sh"

an example compiler_launcher.sh script can be found in dune-common/python/generator/template. Change the DEFAULT_CXXFLAGS there as required.

This default launcher is automatically activated for dune-py so that overloading for Python bindings is always available. The value of CMAKE_CXX_FLAGS used during configuration of the source modules will be used as default flags in this case. By setting CMAKE_CXX_COMPILER_LAUNCHER when dune-py is configured this default launcher can be replaced by a user choice. In addition during runtime the launcher can be changed by setting the environment variable DUNE_CXX_COMPILER_LAUNCHER.

This replaces !1245 (closed).

Edited by Andreas Dedner

Merge request reports