From 48eccdedf267be53404bbb09301084e47f1648ec Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 5 Nov 2023 17:32:11 +0100 Subject: [PATCH] There is too much boost include to protect, disable -Wundef on FreeBSD alltogether --- src/kernel/context/ContextBoost.hpp | 10 ---------- tools/cmake/Flags.cmake | 7 ++++--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/kernel/context/ContextBoost.hpp b/src/kernel/context/ContextBoost.hpp index adca9a2e9f..22295c55a1 100644 --- a/src/kernel/context/ContextBoost.hpp +++ b/src/kernel/context/ContextBoost.hpp @@ -6,12 +6,6 @@ #ifndef SIMGRID_KERNEL_CONTEXT_BOOST_CONTEXT_HPP #define SIMGRID_KERNEL_CONTEXT_BOOST_CONTEXT_HPP -/* Boost uses undef preprocessor symbols on FreeBSD, so disable our Werror for this file */ -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundef" -#endif - #include #if BOOST_VERSION < 106100 #include @@ -19,10 +13,6 @@ #include #endif -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - #include #include #include diff --git a/tools/cmake/Flags.cmake b/tools/cmake/Flags.cmake index 5ec57539b0..e7ba000eb3 100644 --- a/tools/cmake/Flags.cmake +++ b/tools/cmake/Flags.cmake @@ -77,9 +77,10 @@ if(enable_compile_warnings AND enable_debug) endif() # Activate the warnings on #if FOOBAR when FOOBAR has no value -# It used to break on FreeBSD within Boost headers and was only activated in maintainer mode, but I hope it works nowadays -set(warnCFLAGS "${warnCFLAGS} -Wundef") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wundef") +if("${CMAKE_SYSTEM}" MATCHES "Linux") # Breaks on FreeBSD within Boost headers :( + set(warnCFLAGS "${warnCFLAGS} -Wundef") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wundef") +endif() # Set the optimisation flags # NOTE, we should CMAKE_BUILD_TYPE for this -- 2.20.1