From 4f6d8ea12e9f1bf5f66af7a05699e53527dcd304 Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Sun, 15 Jun 2025 02:36:20 +0200 Subject: Improved CMakelists.txt and minor fixes in dir_monitor.c --- CMakeLists.txt | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'CMakeLists.txt') 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 -- cgit v1.2.3-70-g09d2