Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaas Freitag <freitag@owncloud.org>2017-12-01 13:55:42 +0300
committerMarkus Goetz <markus@woboq.com>2017-12-04 14:37:03 +0300
commit0be7b6fe1ff97493fb234cae0687799df803f178 (patch)
tree4771d7a661e5e2b75233e52b0e7463ba3640640a /src/CMakeLists.txt
parentee98daf9ea6d92d0827c2b87637ec548990f1fae (diff)
Only enable -fstack-protector-strong compiler flag for gcc > 4.9
On older/other compilers this flag is not understood.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5319fbdc2..69d805cb9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -13,8 +13,12 @@ if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
elseif(UNIX AND NOT APPLE)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
+ endif()
+ endif()
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
if(CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)")