-
- Downloads
[CMake] Allow adding compile flags upon running make
Autotools users kept complaining, that it is conceptionally disappointing that targets cannot be build with flags set upon entering make (e.g. make CXXFLAGS+="-myflag" mytarget). This patch introduces a small hack, that allows for such feature in cmake. It is, however, (at least) questionable whether we want to include it. Still, for your information and convenience: To use the feature you must: - be using a CMake generator that is based on Makefiles (defaults to true) - set the define ALLOW_EXTRA_CXXFLAGS to true, e.g. by including CMAKE_FLAGS="-DALLOW_EXTRA_CXXFLAGS=1" in your optsfile. - reconfigure your project cmake will then wrap a small shell script around your compiler and allow you to append the content of an environment variable to yout compiler flags. Run for above example: EXTRA_CXXFLAGS="-myflag" make mytarget The additional flags will be visually confirmed if and only if you set the verbosity (as always): EXTRA_CXXFLAGS="-myflag" make VERBOSE=1 mytarget
Loading
Please register or sign in to comment