summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Herlant <aerostitch@debian.org>2020-01-20 09:05:39 -0800
committerJoseph Herlant <aerostitch@debian.org>2020-01-20 09:05:39 -0800
commitfd03e970acfa1491e56d89b2ae9566c4c3e89141 (patch)
tree03e51094f99c5379fe1094caa0e45ae8d97109a5
parent07f885bb6aa214ae050a22c0581cb3a9356ac508 (diff)
downloadnavit-fd03e970acfa1491e56d89b2ae9566c4c3e89141.tar.gz
Simplify the addition of compiler flags and do not rely on non-recommended CMake variable
-rwxr-xr-xCMakeLists.txt22
1 files changed, 11 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 884d1e561..1db62c570 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -826,17 +826,17 @@ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
# functions implementing the interface of a plugin.
# -Wno-sign-compare: We currently just use int almost everywhere.
# Unclear if it's really worth correcting.
-if(CMAKE_COMPILER_IS_GNUCC OR CCMAKE_COMPILER_IS_GNUCXX)
- set(COMMON_COMPILER_FLAGS "-Wall -Wundef -Wcast-align -Wpointer-arith -Wno-unused-parameter -Wno-sign-compare")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}")
- # flags not available in old GCC versions, or not for both C and C++
- add_compiler_flag_if_available("-Wno-missing-field-initializers")
- add_compiler_flag_if_available("-Wextra")
- add_compiler_flag_if_available("-Wmissing-prototypes")
- add_compiler_flag_if_available("-Wstrict-prototypes")
- add_compiler_flag_if_available("-Wformat-security")
-endif()
+add_compiler_flag_if_available("-Wall")
+add_compiler_flag_if_available("-Wno-unused-parameter")
+add_compiler_flag_if_available("-Wno-sign-compare")
+add_compiler_flag_if_available("-Wno-missing-field-initializers")
+add_compiler_flag_if_available("-Wundef")
+add_compiler_flag_if_available("-Wcast-align")
+add_compiler_flag_if_available("-Wpointer-arith")
+add_compiler_flag_if_available("-Wextra")
+add_compiler_flag_if_available("-Wmissing-prototypes")
+add_compiler_flag_if_available("-Wstrict-prototypes")
+add_compiler_flag_if_available("-Wformat-security")
add_compiler_flag_if_available("-Werror=format-security")
add_compiler_flag_if_available("-fstack-protector-strong")
add_compiler_flag_if_available("-D_FORTIFY_SOURCE=2")