Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
There is too much boost include to protect, disable -Wundef on FreeBSD alltogether
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 5 Nov 2023 16:32:11 +0000 (17:32 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 5 Nov 2023 16:32:11 +0000 (17:32 +0100)
src/kernel/context/ContextBoost.hpp
tools/cmake/Flags.cmake

index adca9a2..22295c5 100644 (file)
@@ -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 <boost/version.hpp>
 #if BOOST_VERSION < 106100
 #include <boost/context/fcontext.hpp>
 #include <boost/context/detail/fcontext.hpp>
 #endif
 
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
 #include <atomic>
 #include <cstdint>
 #include <functional>
index 5ec5753..e7ba000 100644 (file)
@@ -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