csmith-project / creduce

C-Reduce, a C and C++ program reducer
Other
1.5k stars 128 forks source link

don't ignore user-specified CXXFLAGS #72

Closed rnburn closed 9 years ago

rnburn commented 9 years ago

In the CMakeLists.txt file, this isn't the proper way to add CXXFLAGS

set(CMAKE_CXX_FLAGS "-std=c++11 -fno-rtti -Wall -Wextra -Wno-long-long -Wno-unused-parameter")

as it ignores those specified on the command line. (See http://voices.canonical.com/jussi.pakkanen/2013/03/26/a-list-of-common-cmake-antipatterns/)

eeide commented 9 years ago

I agree that ignoring user-specified CXXFLAGS is bad.

Is the technique at the referenced web page the right way to resolve this issue? Does a similar fix need to be made for CMAKE_CXX_FLAGS_RELEASE?

I am not a CMake user, so I need advice.

I'll mention that the logic for setting CXXFLAGS the CMakeLists various files is a bit different from that in the Automake files. Notably, (as far as I understand), the CMake rote doesn't try to pull flags out of "llvm-config --cxxflags".

Perhaps the primary contributor of the CMake files can offer some advice, if I mention his GitHub ID here :-). @mpflanzer

eeide commented 9 years ago

Do you have time to investigate this issue in the near future, @mpflanzer ?

mpflanzer commented 9 years ago

Sorry for my late response. I have been busy with relocating over the last weeks. I will try to have a look this weekend. However, I am also in now way an expert in terms of CMake. ;-)

eeide commented 9 years ago

I believe that @mpflanzer's patch has resolved this issue.