From b8f386f3d9e9599c2879afb65c228b0f2805b572 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 16 Sep 2024 17:56:27 +0600 Subject: [PATCH] Fixed building --- source/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 67df707..7ec21c7 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -70,8 +70,14 @@ add_custom_target( #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -lm") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ -O2 -pipe -fno-plt -fexceptions \ - -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ + -Wformat -Werror=format-security \ -fstack-clash-protection -fcf-protection") + + string(FIND "${CMAKE_CXX_FLAGS}" "-D_FORTIFY_SOURCE" FORTIFY_FOUND) + + if(FORTIFY_FOUND EQUAL -1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wp,-D_FORTIFY_SOURCE=2") + endif() set(SOURCE_FILES menu_os.h