From f5186bf0e6c319e34c7033ea7f6c45f6381f9ffd Mon Sep 17 00:00:00 2001 From: medithe Date: Tue, 18 Aug 2020 17:19:40 +0200 Subject: [PATCH] CMakeLists.txt: Added fno-common flag to clang and gcc. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 881b2b22..7c9aff52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,7 +111,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") -Wctor-dtor-privacy -Wdisabled-optimization -Winvalid-pch -Woverloaded-virtual -Wconversion -Wswitch-enum -Wundef - -Wno-ctor-dtor-privacy -Wno-format-nonliteral) + -Wno-ctor-dtor-privacy -Wno-format-nonliteral + -fno-common) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wnoexcept -Wno-dangling-else -Wno-unused-local-typedefs) @@ -130,7 +131,7 @@ endif () if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -pedantic -Wconversion -Wundef - -Wdeprecated -Wweak-vtables) + -Wdeprecated -Wweak-vtables -fno-common) check_cxx_compiler_flag(-Wzero-as-null-pointer-constant HAS_NULLPTR_WARNING) if (HAS_NULLPTR_WARNING) set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS}