Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add -Wno-extern-c-compat when building with clang
authorMatthieu Volat <mazhe@alkumuna.eu>
Mon, 31 Oct 2016 16:49:45 +0000 (17:49 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 1 Nov 2016 13:32:42 +0000 (14:32 +0100)
Else it triggers an warning due to libunwind.h using empty C structures that
are turned into an error by -Werror.

tools/cmake/GCCFlags.cmake

index ab8156f..e7f109f 100644 (file)
@@ -23,8 +23,10 @@ if(enable_compile_warnings)
   if(CMAKE_COMPILER_IS_GNUCXX)
     set(warnCXXFLAGS "${warnCXXFLAGS} -Wclobbered -Wno-error=clobbered  -Wno-unused-local-typedefs -Wno-error=attributes")
   endif()
-  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # don't care about class that become struct
-    set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-mismatched-tags")
+  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)
+    set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-mismatched-tags -Wno-extern-c-compat")
   endif()
 
   # the one specific to C but refused by C++