Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
These options are specific to gcc (not recognized by clang).
[simgrid.git] / buildtools / Cmake / Flags.cmake
index 68cae01..4c1178d 100644 (file)
@@ -11,12 +11,12 @@ else()
 endif()
 
 if(enable_compile_warnings)
-  set(warnCFLAGS "-fno-common -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wclobbered -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror -Wno-error=clobbered ")
-  if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
-    set(warnCFLAGS "${warnCFLAGS}-Wno-error=unused-but-set-variable ")
-  endif()
-  if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
-    string(REPLACE "-Wclobbered " "" warnCFLAGS "${warnCFLAGS}")
+  set(warnCFLAGS "-fno-common -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
+  if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    set(warnCFLAGS "${warnCFLAGS}-Wclobbered -Wno-error=clobbered ")
+    if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
+      set(warnCFLAGS "${warnCFLAGS}-Wno-error=unused-but-set-variable ")
+    endif()
   endif()
 
   set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall") # FIXME: Q&D hack