diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-02-11 13:41:27 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-02-11 13:41:27 +0000 |
| commit | c79bb3e833ccbefec63440f36e7b39459904c771 (patch) | |
| tree | b5b9f95209e4547afa0edd2f15758bc49b813818 /CMakeScripts | |
| parent | Fix build (diff) | |
| download | inkscape-c79bb3e833ccbefec63440f36e7b39459904c771.tar.gz inkscape-c79bb3e833ccbefec63440f36e7b39459904c771.zip | |
Add gcc/version check
Diffstat (limited to '')
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 7505277b5..4cb63aae8 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -21,8 +21,13 @@ list(APPEND INKSCAPE_CXX_FLAGS "-std=c++11") # Errors for common mistakes list(APPEND INKSCAPE_CXX_FLAGS "-Werror=format") # e.g.: printf("%s", std::string("foo")) list(APPEND INKSCAPE_CXX_FLAGS "-Werror=format-security") # e.g.: printf(variable); -list(APPEND INKSCAPE_CXX_FLAGS_DEBUG "-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection") - +list(APPEND INKSCAPE_CXX_FLAGS_DEBUG "-D_FORTIFY_SOURCE=2") +if (CMAKE_COMPILER_IS_GNUCC) +list(APPEND INKSCAPE_CXX_FLAGS_DEBUG "-fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables") +if(CXX_COMPILER_VERSION VERSION_GREATER 8.0) +list(APPEND INKSCAPE_CXX_FLAGS_DEBUG "-fstack-clash-protection -fcf-protection") +endif() +endif() # Define the flags for profiling if desired: if(WITH_PROFILING) set(BUILD_SHARED_LIBS off) |
