From 86566f1c1412c5308a12ade44af21102a1c6f6cf Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:55:41 -0800 Subject: [PATCH] build: Fortify non-MSVC builds. (#7120) --- src/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ffbc5558e0..ac221ad90d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -102,7 +102,13 @@ if (MSVC) else() add_compile_options( -Wall - -Wno-attributes + # In case a flag isn't supported on e.g. a certain architecture, don't error. + -Wno-unused-command-line-argument + # Build fortification options + -Wp,-D_FORTIFY_SOURCE=2 + -Wp,-D_GLIBCXX_ASSERTIONS + -fstack-protector-strong + -fstack-clash-protection ) if (CITRA_WARNINGS_AS_ERRORS)