]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
cmake: add -fno-common when !MSVC
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 3 Jan 2022 17:50:19 +0000 (21:50 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 21 Jan 2022 17:16:45 +0000 (21:16 +0400)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
CMakeLists.txt

index 713e8534828e95572a81c88ad1d28702bfd6daf7..a60428a0ab3a4a16590192549dfadda8981b8595 100644 (file)
@@ -228,10 +228,12 @@ endif()
 #
 # setup warnings
 #
-# We're treating -fno-common like a warning: it makes the linker more
-# strict, because on some systems the linker is *always* this strict
-string(APPEND CMAKE_C_FLAGS " -fno-common")
-string(APPEND CMAKE_CXX_FLAGS " -fno-common")
+if(NOT MSVC)
+    # We're treating -fno-common like a warning: it makes the linker more
+    # strict, because on some systems the linker is *always* this strict
+    string(APPEND CMAKE_C_FLAGS " -fno-common")
+    string(APPEND CMAKE_CXX_FLAGS " -fno-common")
+endif()
 
 option(ENABLE_WERROR "Unconditionally make all compiler warnings fatal" OFF)