summaryrefslogtreecommitdiff
path: root/CompilerChecks.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CompilerChecks.cmake')
-rw-r--r--CompilerChecks.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake
index f07929c..b326807 100644
--- a/CompilerChecks.cmake
+++ b/CompilerChecks.cmake
@@ -41,6 +41,7 @@ if (UNIX)
add_c_compiler_flag("-Werror=strict-overflow" SUPPORTED_COMPILER_FLAGS)
add_c_compiler_flag("-Wstrict-overflow=2" SUPPORTED_COMPILER_FLAGS)
add_c_compiler_flag("-Wno-format-zero-length" SUPPORTED_COMPILER_FLAGS)
+ add_c_compiler_flag("-Wmissing-field-initializers" SUPPORTED_COMPILER_FLAGS)
check_c_compiler_flag("-Wformat" REQUIRED_FLAGS_WFORMAT)
if (REQUIRED_FLAGS_WFORMAT)
@@ -51,7 +52,10 @@ if (UNIX)
add_c_compiler_flag("-Werror=format-security" SUPPORTED_COMPILER_FLAGS)
# Allow zero for a variadic macro argument
- add_c_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments" SUPPORTED_COMPILER_FLAGS)
+ string(TOLOWER "${CMAKE_C_COMPILER_ID}" _C_COMPILER_ID)
+ if ("${_C_COMPILER_ID}" STREQUAL "clang")
+ add_c_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments" SUPPORTED_COMPILER_FLAGS)
+ endif()
add_c_compiler_flag("-fno-common" SUPPORTED_COMPILER_FLAGS)