Skip to content

Commit 907a5ae

Browse files
committed
clang guard for -fstack-protector-strong
1 parent 9a0889c commit 907a5ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/compilerFlags.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN
3939
endif()
4040

4141
add_compile_options(-Wall -Wcast-align -Wpointer-arith -Wformat-security -Wmissing-format-attribute -Woverloaded-virtual -W)
42-
add_compile_options(-fstack-protector-strong)
4342
add_compile_options(-fasynchronous-unwind-tables)
4443

44+
if (COMPILER_IS_GCC OR (COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.7 ))
45+
# is not available for clang 3.4.2. it appears to be present in clang 3.7.
46+
add_compile_options(-fstack-protector-strong)
47+
endif()
4548

4649
if ( EXIV2_TEAM_USE_SANITIZERS )
4750
# ASAN is available in gcc from 4.8 and UBSAN from 4.9

0 commit comments

Comments
 (0)