Commit 7b6138a4 authored by jcfr's avatar jcfr

ENH: C/CXX coverage flags automatically added if WITH_COVERAGE ON and compiler is GNUCXX

git-svn-id: http://svn.slicer.org/Slicer4/trunk@15177 3bd1e089-480b-0410-8dfb-8563597acbee
parent 9897118a
......@@ -164,11 +164,22 @@ MARK_AS_ADVANCED(ADDITIONAL_C_FLAGS)
SET(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags")
MARK_AS_ADVANCED(ADDITIONAL_CXX_FLAGS)
#-----------------------------------------------------------------------------
# Set coverage Flags
#-----------------------------------------------------------------------------
IF(WITH_COVERAGE)
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(coverage_flags "-g -fprofile-arcs -ftest-coverage -O0 -DNDEBUG")
SET(COVERAGE_CXX_FLAGS ${coverage_flags})
SET(COVERAGE_C_FLAGS ${coverage_flags})
ENDIF()
ENDIF()
#-----------------------------------------------------------------------------
# Slicer C/CXX Flags
#-----------------------------------------------------------------------------
SET(Slicer_C_FLAGS "${ADDITIONAL_C_FLAGS}")
SET(Slicer_CXX_FLAGS "${ADDITIONAL_CXX_FLAGS}")
SET(Slicer_C_FLAGS "${COVERAGE_C_FLAGS} ${ADDITIONAL_C_FLAGS}")
SET(Slicer_CXX_FLAGS "${COVERAGE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAGS}")
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(cflags "-Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -D_FORTIFY_SOURCE=2")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment