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