aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-10-16 08:46:06 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-10-16 08:46:25 +0200
commitd6b6fff7f723d9f7b3ad8a9bf5b7e8dbd5f22b8f (patch)
tree5367e037f2219d79cb53e25073884d932b2595cf
parent259d7de1536cd24aac859af340f145776c06ad03 (diff)
downloadlibssh-d6b6fff7f723d9f7b3ad8a9bf5b7e8dbd5f22b8f.tar.gz
libssh-d6b6fff7f723d9f7b3ad8a9bf5b7e8dbd5f22b8f.tar.xz
libssh-d6b6fff7f723d9f7b3ad8a9bf5b7e8dbd5f22b8f.zip
cmake: Only check for -Wno-gnu-zero-variadic-macro-arguments with clang
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--CompilerChecks.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake
index be428dc2..3b36cc6c 100644
--- a/CompilerChecks.cmake
+++ b/CompilerChecks.cmake
@@ -51,7 +51,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)