From faaf83a49eb489b66756e08ab9fd361aa44101e5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 18:04:01 +0100 Subject: [PATCH] [release-0.4] cmake: Check for -fno-common and use it if available --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a75863509..b6dd57862b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -314,6 +314,11 @@ if(UNIX) endif() endif() +check_c_compiler_flag(-fno-common HAVE_FNO_COMMON) +if (HAVE_FNO_COMMON) + add_compile_options(-fno-common) +endif() + check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) if(HAS_DIAG_COLOR_FLAG) if(CMAKE_GENERATOR MATCHES "Ninja")