From ebee1732c2665e507031a6e2ad8f6c40a3669a45 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 5 Jul 2024 16:00:10 +0600 Subject: [PATCH] Fixed FORTIFY_SOURCE error --- source/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index ff57779..b1d25fe 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -92,6 +92,12 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Wmissing-declarations -Wp,-D_FORTIFY_SOURCE=2 -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 ubinstall-gtk.c ubinstall-gtk.h