cmake: stack-protector-strong only supported on gcc 4.9+
@@ -113,10 +113,13 @@ if(LNX_BUILD)
-D_GNU_SOURCE
-D__LINUX__
)
-
+ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.8)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong")
+ endif()
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
endif()
+endif()
#----------------------------------------------------------------------------------------------------
# OS driver interface library
