aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-11-07 09:25:54 +0100
committerAndreas Schneider <asn@samba.org>2018-11-07 15:29:44 +0100
commit51fcd0af8a7017aea779b8516d7520df20bec454 (patch)
tree846ab8fc25b8694760db182c5426a68997f24f4e
parentd9a6ecb148ae6fe485e8b7416cd5b8265e22804f (diff)
downloadsocket_wrapper-51fcd0af8a7017aea779b8516d7520df20bec454.tar.gz
socket_wrapper-51fcd0af8a7017aea779b8516d7520df20bec454.tar.xz
socket_wrapper-51fcd0af8a7017aea779b8516d7520df20bec454.zip
cmake: Only set default flags if they have been detected
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--CompilerChecks.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake
index 5e9d830..4fa1a83 100644
--- a/CompilerChecks.cmake
+++ b/CompilerChecks.cmake
@@ -106,5 +106,9 @@ if (MSVC)
add_c_compiler_flag("/D _CRT_SECURE_NO_WARNINGS=1" SUPPORTED_COMPILER_FLAGS)
endif()
-set(DEFAULT_C_COMPILE_FLAGS ${SUPPORTED_COMPILER_FLAGS} CACHE INTERNAL "Default C Compiler Flags" FORCE)
-set(DEFAULT_LINK_FLAGS ${SUPPORTED_LINKER_FLAGS} CACHE INTERNAL "Default C Linker Flags" FORCE)
+if (SUPPORTED_COMPILER_FLAGS)
+ set(DEFAULT_C_COMPILE_FLAGS ${SUPPORTED_COMPILER_FLAGS} CACHE INTERNAL "Default C Compiler Flags" FORCE)
+endif()
+if (SUPPORTED_LINKER_FLAGS)
+ set(DEFAULT_LINK_FLAGS ${SUPPORTED_LINKER_FLAGS} CACHE INTERNAL "Default C Linker Flags" FORCE)
+endif()