]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
refactor(cmake): move and clean (prettify) aggressive warning compilation option...
authorGbkng <guillaume.brooking@gmail.com>
Mon, 15 Apr 2024 08:31:16 +0000 (10:31 +0200)
committerGbkng <guillaume.brooking@gmail.com>
Tue, 23 Apr 2024 07:48:25 +0000 (09:48 +0200)
CMakeLists.txt

index a64dd9576e4f2a46e2125eba17496b74089a964f..3a748111bd590af2d9f9f4e7e9a71e9d72c1c2fc 100644 (file)
@@ -61,33 +61,8 @@ MESSAGE(STATUS "Building ${PROJECT_NAME_UC} ${${PROJECT_NAME_UC}_VERSION} from \
 # ==============
 INCLUDE(SalomeSetupPlatform)
 
-# [ABN]: use the below for aggressive code quality check: 
-#if( EXISTS "aaaa")
-#    add_definitions(-Weverything)
-#    add_definitions(-Wno-inconsistent-missing-override)
-#    add_definitions(-Wno-c++98-compat -Wno-c++98-compat-pedantic)
-#    add_definitions(-Wsign-conversion)
-#    add_definitions(-Wno-switch-enum)
-#
-#    add_definitions(-Wno-documentation-unknown-command) # \image in Doxygen
-#    add_definitions(-Wno-gnu-statement-expression)      # assert(...)
-#
-#    add_definitions(-Wno-reserved-id-macro -Wno-padded -Wno-weak-vtables -Wdouble-promotion -Wno-comma -Wno-unused-parameter)
-#    add_definitions(-Wno-unreachable-code-break -Wno-old-style-cast -Wno-deprecated -Wno-double-promotion)
-#    add_definitions(-Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes)
-#    add_definitions(-Wno-covered-switch-default -Wno-weak-template-vtables -Wno-undefined-func-template -Wno-used-but-marked-unused)
-#    add_definitions(-Wno-unreachable-code-return -Wno-missing-noreturn -Wno-unused-member-function -Wno-header-hygiene)
-#    add_definitions(-Wno-ignored-qualifiers) # because of MED-file 
-#    add_definitions(-Wno-unused-function -Wno-unused-macros)
-#    add_definitions(-Wno-missing-field-initializers)
-#    add_definitions(-Wno-shadow)  # SWIG generates a lot of those ...
-#
-#    add_definitions(-Wno-float-equal)  # OUCH
-#endif()
-
-#
-# User options
-# ============
+# Compilation options
+# ===================
 INCLUDE(CMakeDependentOption)
 OPTION(MEDCOUPLING_MICROMED "Build MED without MED file dependency." OFF)
 OPTION(MEDCOUPLING_ENABLE_PYTHON "Build PYTHON bindings." ON)
@@ -100,6 +75,27 @@ OPTION(MEDCOUPLING_BUILD_PY_TESTS "Build MEDCoupling Python tests." ON)
 OPTION(MEDCOUPLING_BUILD_DOC "Build MEDCoupling doc." ON)
 OPTION(MEDCOUPLING_BUILD_STATIC "Build MEDCoupling library in static mode." OFF)
 OPTION(MEDCOUPLING_USE_64BIT_IDS "Size of IDs to refer cells and nodes. 32 bits when OFF (default), 64 bits when ON." ON)
+OPTION(MEDCOUPLING_AGGRESSIVE_WARNING "Activate this option for aggressive code quality check" OFF)
+
+if(MEDCOUPLING_AGGRESSIVE_WARNING)
+    add_definitions(-Weverything)
+    add_definitions(-Wno-inconsistent-missing-override)
+    add_definitions(-Wno-c++98-compat -Wno-c++98-compat-pedantic)
+    add_definitions(-Wsign-conversion)
+    add_definitions(-Wno-switch-enum)
+    add_definitions(-Wno-documentation-unknown-command) # \image in Doxygen
+    add_definitions(-Wno-gnu-statement-expression)      # assert(...)
+    add_definitions(-Wno-reserved-id-macro -Wno-padded -Wno-weak-vtables -Wdouble-promotion -Wno-comma -Wno-unused-parameter)
+    add_definitions(-Wno-unreachable-code-break -Wno-old-style-cast -Wno-deprecated -Wno-double-promotion)
+    add_definitions(-Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes)
+    add_definitions(-Wno-covered-switch-default -Wno-weak-template-vtables -Wno-undefined-func-template -Wno-used-but-marked-unused)
+    add_definitions(-Wno-unreachable-code-return -Wno-missing-noreturn -Wno-unused-member-function -Wno-header-hygiene)
+    add_definitions(-Wno-ignored-qualifiers) # because of MED-file 
+    add_definitions(-Wno-unused-function -Wno-unused-macros)
+    add_definitions(-Wno-missing-field-initializers)
+    add_definitions(-Wno-shadow)  # SWIG generates a lot of those ...
+    add_definitions(-Wno-float-equal)  # OUCH
+endif()
 
 IF(${MEDCOUPLING_USE_MPI})
   SET(USE_METIS_NOT_PARMETIS OFF)