From 3d45a2e5a290e63246d218267063a8321eb452a1 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sat, 5 May 2012 09:42:25 +0200 Subject: [PATCH] Fix C compiler warning. "no-overloaded-virtual" warnings are a CXX-compiler feature --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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}