diff --git a/CMakeLists.txt b/CMakeLists.txt index ef5564e20..db3892ca1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,11 +273,13 @@ if(ENABLE_RTI) endif(ENABLE_RTI) if(CMAKE_COMPILER_IS_GNUCXX) - set(WARNING_FLAGS -Wall) + set(WARNING_FLAGS_CXX "-Wall") + set(WARNING_FLAGS_C "-Wall") endif(CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set (WARNING_FLAGS "-Wall -Wno-overloaded-virtual") + set (WARNING_FLAGS_CXX "-Wall -Wno-overloaded-virtual") + set (WARNING_FLAGS_C "-Wall") endif() if(WIN32) @@ -297,8 +299,8 @@ if(WIN32) set(NOMINMAX 1) endif(WIN32) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS_C} ${MSVC_FLAGS} -D_REENTRANT") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_CXX} ${MSVC_FLAGS} -D_REENTRANT") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}") include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}