From: Lucian Petrut Date: Tue, 23 Jun 2020 09:00:54 +0000 (+0000) Subject: build: disable stack protection on Windows X-Git-Tag: v17.0.0~575^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8d35b2eceabafbe13458101f8701e3fc49f15d63;p=ceph-ci.git build: disable stack protection on Windows Passing "-fstack-protector-strong" doesn't seem to work with Mingw, complaining about undefied "__stack_chk_fail". For this reason, we'll disable it for now. Signed-off-by: Lucian Petrut --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b8110eab621..2af3f66e3d4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,10 +126,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) -D_FORTIFY_SOURCE=2) endif() endif() - CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STACK_PROTECT) - if (HAS_STACK_PROTECT) - add_compile_options(-fstack-protector-strong) - endif() + if(NOT WIN32) + CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STACK_PROTECT) + if (HAS_STACK_PROTECT) + add_compile_options(-fstack-protector-strong) + endif() + endif(NOT WIN32) endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU) CHECK_C_COMPILER_FLAG("-D_GLIBCXX_ASSERTIONS" HAS_GLIBCXX_ASSERTIONS)