diff options
| author | Thorsten Töpper <atsutane@freethoughts.de> | 2025-06-16 20:20:20 +0200 |
|---|---|---|
| committer | Thorsten Töpper <atsutane@freethoughts.de> | 2025-06-16 20:20:20 +0200 |
| commit | be8f8a9f4caa883e3de98b276cdad55d4fc65c0d (patch) | |
| tree | 40148ab39566cfa614ca9a5e64049ff54cdd1e84 /CMakeLists.txt | |
| parent | 62e45906f1ffcaa2e3039a4306c01465c3eadfd8 (diff) | |
| download | dir_monitor-be8f8a9f4caa883e3de98b276cdad55d4fc65c0d.tar.gz dir_monitor-be8f8a9f4caa883e3de98b276cdad55d4fc65c0d.tar.bz2 | |
CMakeLists: hardening flags
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 163f941..f9e3ad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,9 @@ project(dir_monitor # prevent errors from unbeknown features, used to and assuming to be there longer... set (CMAKE_C_STANDARD 17) -add_compile_options(-Wall) +add_compile_options(-Wall -Wextra -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough -Werror=format-security + -Wbidi-chars=any -Werror=implicit -Werror=incompatible-pointer-types -Werror=int-conversion + -fno-delete-null-pointer-checks -fstack-clash-protection -fstack-protector-strong -fstrict-flex-arrays=3) set(SOURCE_DM src/dir_monitor.c src/list_management.c src/options.c src/output.c) @@ -28,5 +30,5 @@ target_link_libraries(dir_monitor_asan asan) add_executable(dir_monitor ${SOURCE_DM}) target_include_directories(dir_monitor PRIVATE include) -target_compile_options(dir_monitor_debug PUBLIC -O2 -Werror) +target_compile_options(dir_monitor PUBLIC -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -FPIE -pie -Wl,-z,noexecstack -Wl,--as-needed -Wl,--no-copy-dt-needed-entries) |
