Explorar el Código

Merge branch 'fix-stack-protector-all-introduce-dependency'

* fix-stack-protector-all-introduce-dependency:
  Also check if CMAKE_BUILD_TYPE is defined before adding stack-protect flag
Jean-Christophe Fillion-Robin hace 14 años
padre
commit
75e10ee2e8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      CMakeLists.txt

+ 1 - 1
CMakeLists.txt

@@ -262,7 +262,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
   # With older version of gcc supporting the flag -fstack-protector-all, an extra dependency to libssp.so
   # 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.
   # 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.
   # Doing so should allow to build package made for distribution using older linux distro.
-  IF(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (${CMAKE_BUILD_TYPE} 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"))
     ctkFunctionCheckCompilerFlags("-fstack-protector-all" cflags)
     ctkFunctionCheckCompilerFlags("-fstack-protector-all" cflags)
   ENDIF()
   ENDIF()
   IF(MINGW)
   IF(MINGW)