From 8d35b2eceabafbe13458101f8701e3fc49f15d63 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Tue, 23 Jun 2020 09:00:54 +0000 Subject: [PATCH] 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 --- src/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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) -- 2.47.3