diff options
author | Michael Reed <Pyrohh@users.noreply.github.com> | 2016-01-13 23:49:13 -0500 |
---|---|---|
committer | Michael Reed <Pyrohh@users.noreply.github.com> | 2016-01-13 23:49:13 -0500 |
commit | bf7bc4dcf0023eb493c0b1d7860e72f3dcd04d78 (patch) | |
tree | 8bd8f086236af2673415672d456cd9dd709873c6 | |
parent | 269f3ac779ec607cc334ae03dafd19a150048029 (diff) | |
parent | 54a1fb77e7cb629fffdd3a40416ed6a42c3fd569 (diff) | |
download | rneovim-bf7bc4dcf0023eb493c0b1d7860e72f3dcd04d78.tar.gz rneovim-bf7bc4dcf0023eb493c0b1d7860e72f3dcd04d78.tar.bz2 rneovim-bf7bc4dcf0023eb493c0b1d7860e72f3dcd04d78.zip |
Merge pull request #4005 from sethjackson/stack-protector
[RFC] MinGW: don't use -fstack-protector
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c12486d4e..74130debf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,12 +216,16 @@ if(HAS_WVLA_FLAG) add_definitions(-Wvla) endif() -check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG) -check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG) -if(HAS_FSTACK_PROTECTOR_STRONG_FLAG) - add_definitions(-fstack-protector-strong) -elseif(HAS_FSTACK_PROTECTOR_FLAG) - add_definitions(-fstack-protector --param ssp-buffer-size=4) +if(UNIX) + # -fstack-protector breaks non Unix builds even in Mingw-w64 + check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG) + check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG) + + if(HAS_FSTACK_PROTECTOR_STRONG_FLAG) + add_definitions(-fstack-protector-strong) + elseif(HAS_FSTACK_PROTECTOR_FLAG) + add_definitions(-fstack-protector --param ssp-buffer-size=4) + endif() endif() check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) |