I have a project like this:
|--CMakeLists.txt(1)
|--File1.cpp -W -W-all
|--Folder1
|--CMakeLists.txt(2)
|--File2.cpp -W -W-all -fno-rtti
As you can see above, File2.cpp
needs to compile with -fno-rtti
whereas the other files should compile with rtti
. This is happening because I'm using both clang and boost libraries in my project.
I wrote CMakeLists.txt(1)
like this:
SET (CMAKE_CXX_FLAGS "-std=c++11 -fexceptions -fno-rtti -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -Wno-long-long" )
And, in CMakeLists.txt(2)
I added the following:
add_definitions( -fno-rtti )
The above did not work. In fact none of the following have worked for me in CMakeLists.txt(2)
set_property(SOURCE File2.cpp APPEND_STRING PROPERTY CMAKE_CXX_FLAGS " -fno-rtti ")
set_property(SOURCE File2.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " -fno-rtti ")
ADD_DEFINITIONS(CMAKE_CXX_FLAGS " -fno-rtti ")
ADD_DEFINITIONS(COMPILE_FLAGS " -fno-rtti ")
ADD_DEFINITIONS( -fno-rtti )
Am I missing anything?