Fix C compiler warning.

"no-overloaded-virtual" warnings are a CXX-compiler feature
This commit is contained in:
ThorstenB 2012-05-05 09:46:11 +02:00
parent 0908f86714
commit 6129de31f0

View File

@ -191,7 +191,8 @@ check_cxx_source_compiles(
HAVE_ISNAN)
if(CMAKE_COMPILER_IS_GNUCXX)
set(WARNING_FLAGS -Wall)
set(WARNING_FLAGS_CXX "-Wall")
set(WARNING_FLAGS_C "-Wall")
# certain GCC versions don't provide the atomic builds, and hence
# require is to provide them in SGAtomic.cxx
@ -201,6 +202,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
GCC_ATOMIC_BUILTINS_FOUND)
endif(CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(WARNING_FLAGS_CXX "-Wall -Wno-overloaded-virtual")
set(WARNING_FLAGS_C "-Wall")
endif()
if(WIN32)
if(MINGW)
@ -223,12 +229,8 @@ if(WIN32)
set( RT_LIBRARY "winmm" )
endif(WIN32)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (WARNING_FLAGS "-Wall -Wno-overloaded-virtual")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} ${BOOST_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS_C} ${MSVC_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_CXX} ${MSVC_FLAGS} ${BOOST_CXX_FLAGS}")
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR}/simgear)