diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index bb223ffe..a3ebbbb6 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -30,8 +30,15 @@ endif() function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE -fstack-protector-all) + target_compile_options(${TARGET} PRIVATE -fpie) + target_compile_options(${TARGET} PRIVATE -fpic) target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") + target_link_options(${TARGET} PRIVATE -fstack-protector-all) + target_link_options(${TARGET} PRIVATE -pie) + target_link_options(${TARGET} PRIVATE -Wl,-z,noexecstack) + target_link_options(${TARGET} PRIVATE -Wl,-z,relro,-z,now) endfunction() set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") @@ -128,4 +135,4 @@ install(FILES "../assets/graphics/app-icon.png" install(FILES "../resources/linux/desktop_integration.sh" DESTINATION "${BUILD_BUNDLE_DIR}" - PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE) \ No newline at end of file + PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE)