Commit 59a6338b authored by jcfr's avatar jcfr
Browse files

COMP: CMakeLists.txt - Check if CMAKE_BUILD_TYPE is defined to conditionally...

COMP: CMakeLists.txt - Check if CMAKE_BUILD_TYPE is defined to conditionally add fstack-protector-all flag

git-svn-id: http://svn.slicer.org/Slicer4/trunk@15666 3bd1e089-480b-0410-8dfb-8563597acbee
parent 70a67d2a
......@@ -205,14 +205,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
# With older version of gcc supporting the flag -fstack-protector-all, an extra dependency to libssp.so
# is introduced. If gcc is smaller than 4.4.0 and the build type is Release let's not include the flag.
# Doing so should allow to build package made for distribution using older linux distro.
IF(${CMAKE_BUILD_TYPE})
SET(GCC_BUILD_TYPE_CHECK ${CMAKE_BUILD_TYPE})
ELSE(${CMAKE_BUILD_TYPE})
SET(GCC_BUILD_TYPE_CHECK "Debug")
ENDIF(${CMAKE_BUILD_TYPE})
IF(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (${GCC_BUILD_TYPE_CHECK} STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0"))
IF(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (DEFINED CMAKE_BUILD_TYPE AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0"))
SlicerFunctionCheckCompilerFlags("-fstack-protector-all" cflags)
ENDIF()
IF(MINGW)
......
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