Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix build with -Werror on older g++.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Apr 2022 19:43:42 +0000 (21:43 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Apr 2022 19:43:46 +0000 (21:43 +0200)
tools/cmake/Flags.cmake

index 7e98b43..1df1195 100644 (file)
@@ -42,6 +42,10 @@ if(enable_compile_warnings)
   if(CMAKE_COMPILER_IS_GNUCXX)
     set(warnCXXFLAGS "${warnCXXFLAGS} -Wclobbered -Wno-error=clobbered  -Wno-unused-local-typedefs -Wno-error=attributes -Wno-error=maybe-uninitialized")
   endif()
+  if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0")
+    # workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81767
+    set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-error=unused-variable")
+  endif()
   if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     # don't care about class that become struct, avoid issue of empty C structs
     # size (coming from libunwind.h)