]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Compile with Werror
authoradam <adam>
Fri, 4 Mar 2011 10:09:16 +0000 (10:09 +0000)
committeradam <adam>
Fri, 4 Mar 2011 10:09:16 +0000 (10:09 +0000)
salome_adm/cmake_files/FindPLATFORM.cmake

index 707e214b8667c8fc9e8c9920d2891943e6a474fe..4a4e8dcfd2db5f0fb14b8634166ced4bb8c8458b 100644 (file)
@@ -45,6 +45,16 @@ IF(CMAKE_BUILD_TYPE)
     MARK_AS_ADVANCED(CLEAR CMAKE_CONFIGURATION_TYPES)
     SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE)
   ELSE(WINDOWS)
+    SET(TROLL_VAL $ENV{I_AM_A_TROLL_I_DO_NOT_FIX_${MODULE}_WARNINGS})
+    IF(X${TROLL_VAL} STREQUAL X1)
+    ELSE(X${TROLL_VAL} STREQUAL X1)
+      SET(CMAKE_C_FLAGS "-Werror")
+      SET(CMAKE_CXX_FLAGS "-Werror")
+    ENDIF(X${TROLL_VAL} STREQUAL X1)
+    IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+      SET(CMAKE_C_FLAGS_DEBUG "-g")
+      SET(CMAKE_CXX_FLAGS_DEBUG "-g")
+    ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
     IF(CMAKE_BUILD_TYPE STREQUAL Release)
       SET(CMAKE_C_FLAGS_RELEASE "-O1 -DNDEBUG")
       SET(CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG")
@@ -66,6 +76,10 @@ IF(WINDOWS)
   SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Ws2_32.lib)
   SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Userenv.lib) # At least for GEOM suit
 ELSE(WINDOWS)
+  # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wparentheses)
+  # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wreturn-type)
+  # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wmissing-declarations)
+  # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wunused)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wall)
   SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl)
 ENDIF(WINDOWS)