From 5c5b5082b590b27ed92759817e12c48d09c95a01 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 15 Jun 2012 10:06:34 +0000 Subject: [PATCH] apply -Wall only on our own (gmsh kernel) code --- CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1695279db7..c00ecbc275 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -937,6 +937,7 @@ if(WIN32 OR CYGWIN) list(APPEND EXTERNAL_LIBRARIES wsock32 ws2_32) endif(WIN32 OR CYGWIN) +# disable compile optimization on some known problematic files check_cxx_compiler_flag("-O0" NOOPT) if(NOOPT) file(GLOB_RECURSE NON_OPTIMIZED_SRC Numeric/robustPredicates.cpp Mesh/BDS.cpp @@ -944,6 +945,15 @@ if(NOOPT) set_source_files_properties(${NON_OPTIMIZED_SRC} COMPILE_FLAGS "-O0") endif(NOOPT) +# force full warnings to encourage everybody to write clean(er) code +check_cxx_compiler_flag("-Wall" WALL) +if(WALL) + file(GLOB_RECURSE WALL_SRC Common/*.cpp Fltk/*.cpp FunctionSpace/*.cpp + Geo/*.cpp Graphics/*.cpp Mesh/*.cpp Numeric/*.cpp Parser/*.cpp + Plugin/*.cpp Post/*.cpp Qt/*.cpp Solver/*.cpp) + set_source_files_properties(${WALL_SRC} COMPILE_FLAGS "-Wall") +endif(WALL) + list(SORT CONFIG_OPTIONS) set(GMSH_CONFIG_OPTIONS "") foreach(OPT ${CONFIG_OPTIONS}) @@ -1071,12 +1081,6 @@ elseif(MSVC) set_target_properties(gmsh PROPERTIES LINK_FLAGS "/STACK:16777216") endif(WIN32 AND NOT MSVC OR CYGWIN) -# force full warnings to encourage everybody to write clean(er) code -check_cxx_compiler_flag("-Wall" WALL) -if(WALL) - set_target_properties(gmsh lib shared PROPERTIES COMPILE_FLAGS "-Wall") -endif(WALL) - find_program(BISON bison) find_program(FLEX flex) if(BISON AND FLEX) -- GitLab