From: Marc-André Lureau Date: Mon, 3 Jan 2022 17:50:19 +0000 (+0400) Subject: cmake: add -fno-common when !MSVC X-Git-Tag: dbus-1.13.22~11^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a5f1cfda7351f8c96dc1cab89cc030e1f28a00e;p=thirdparty%2Fdbus.git cmake: add -fno-common when !MSVC Signed-off-by: Marc-André Lureau --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 713e85348..a60428a0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)