From a96ee0b41a3a5e553ddef838ab66cabb536e1e0f Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Mon, 12 Oct 2020 13:13:28 +0200 Subject: [PATCH] Fix build with gcc10 --- CMakeLists.txt | 5 +++++ src/di.hpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a21e7e..e37f8dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,11 @@ endif() add_library(Warnings INTERFACE) target_compile_options(Warnings INTERFACE ${WARNINGS}) +# Workaround for gcc10 linking errors +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon") +endif() + if(WINDOWS) else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -funsigned-char") diff --git a/src/di.hpp b/src/di.hpp index b15b3e7..3f82620 100644 --- a/src/di.hpp +++ b/src/di.hpp @@ -70,7 +70,7 @@ BOOST_DI_CFG_FWD # pragma clang diagnostic error "-Wundefined-internal" # pragma clang diagnostic ignored "-Wmissing-field-initializers" # elif defined(__GCC__) -# pragma GCC diagnostic error "-Wdeprecated-declarations" +# pragma GCC diagnostic warning "-Wdeprecated-declarations" # pragma GCC diagnostic push # if (__GNUC__ < 6) # pragma GCC diagnostic error "-Werror"