]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CMake: added advanced options SALOME_BUILD_FOR_GCOV to add flags:
authorbruneton <bruneton>
Tue, 17 Sep 2013 12:25:42 +0000 (12:25 +0000)
committerbruneton <bruneton>
Tue, 17 Sep 2013 12:25:42 +0000 (12:25 +0000)
    -fprofile-arcs
    -ftest-coverage
to compiler flags.

salome_adm/cmake_files/SalomeSetupPlatform.cmake

index 317be31c51792556b722f59eaad40b5fcc71fb65..57b5f2fd4e89a92e537df6415705f6f192ca972a 100644 (file)
@@ -116,3 +116,13 @@ IF(APPLE)
   SET(CMAKE_CXX_COMPILER g++)
   # because default is clang(llvm) with mountain lion at least
 ENDIF()
+
+# Compiler flags for coverage testing
+IF(NOT WIN32) 
+  OPTION(SALOME_BUILD_FOR_GCOV "Add the compilation flags for GCov/LCov" OFF)
+  MARK_AS_ADVANCED(SALOME_BUILD_FOR_GCOV)
+  IF(SALOME_BUILD_FOR_GCOV)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
+    SET(CMAKE_C_FLAGS    "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+  ENDIF()
+ENDIF()