Fix build with GCC that does not support the -Wsuggest-override option.

This commit is contained in:
Ghislain MARY 2017-02-13 15:01:43 +01:00
parent 1b3fce8df3
commit 6cbb0633be

View file

@ -28,13 +28,15 @@ set(TARGET_NAME linphone-qt)
set(CMAKE_CXX_STANDARD 11)
include(GNUInstallDirs)
include(CheckCXXCompilerFlag)
# Use automatically moc from Qt5.
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(NOT WIN32)
set(CUSTOM_FLAGS "\
check_cxx_compiler_flag("-Wsuggest-override" SUGGEST_OVERRIDE)
set(CUSTOM_FLAGS "\
-Wall \
-Wcast-align \
-Wconversion \
@ -47,10 +49,12 @@ set(CUSTOM_FLAGS "\
-Wold-style-cast \
-Woverloaded-virtual \
-Wpointer-arith \
-Wsuggest-override \
-Wuninitialized \
-Wunused \
")
if(SUGGEST_OVERRIDE)
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -Wsuggest-override")
endif()
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG")