aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorThorsten Töpper <atsutane@freethoughts.de>2025-06-15 02:36:20 +0200
committerThorsten Töpper <atsutane@freethoughts.de>2025-06-15 02:36:20 +0200
commit4f6d8ea12e9f1bf5f66af7a05699e53527dcd304 (patch)
tree2268b3483eb435c79438b2f39f26161147c17c6a /CMakeLists.txt
parenta8d2c8044dbdd7cffa475d894843e32747a30eee (diff)
downloaddir_monitor-4f6d8ea12e9f1bf5f66af7a05699e53527dcd304.tar.gz
dir_monitor-4f6d8ea12e9f1bf5f66af7a05699e53527dcd304.tar.bz2
Improved CMakelists.txt and minor fixes in dir_monitor.c
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 9 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fdbe0c..0e9238a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,27 +4,24 @@ project(dir_monitor
LANGUAGES C
)
-set(SOURCE_DM src/dir_monitor.c)
+# Although C11 would be sufficient, be safe to set this minimum in order to
+# prevent errors from unbeknown features, used to and assuming to be there longer...
+set (CMAKE_C_STANDARD 17)
-add_executable(dir_monitor ${SOURCE_DM})
+add_compile_options(-Wall)
+
+set(SOURCE_DM src/dir_monitor.c)
add_executable(dir_monitor_debug ${SOURCE_DM})
-target_compile_options(dir_monitor_debug PUBLIC -g -DDEBUGBUILD)
+target_compile_options(dir_monitor_debug PUBLIC -g -DDEBUGBUILD -Werror)
add_executable(dir_monitor_debug_asan ${SOURCE_DM})
-target_compile_options(dir_monitor_debug_asan PUBLIC -g -DDEBUGBUILD -fsanitize=address)
+target_compile_options(dir_monitor_debug_asan PUBLIC -g -DDEBUGBUILD -fsanitize=address -Werror)
target_link_libraries(dir_monitor_debug_asan asan)
add_executable(dir_monitor_asan ${SOURCE_DM})
target_compile_options(dir_monitor_asan PUBLIC -fsanitize=address)
target_link_libraries(dir_monitor_asan asan)
+add_executable(dir_monitor ${SOURCE_DM})
-# bin/dir_monitor: bin $(source)
-# gcc -o $@ $(source) -O2
-# bin/dir_monitor_debug: bin $(source)
-# gcc -o $@ $(source) -g -DDEBUGBUILD
-# bin/dir_monitor_debug_asan: bin $(source)
-# gcc -o $@ $(source) -g -DDEBUGBUILD -fsanitize=address
-# bin/dir_monitor_asan: bin $(source)
-# gcc -o $@ $(source) -g -fsanitize=address