From f84da1cfee5a5fe63843b3e4420dadea824df132 Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Sat, 14 Jun 2025 17:44:25 +0200 Subject: Switch to cmake --- CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 CMakeLists.txt (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0fdbe0c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.15...4.0) + +project(dir_monitor + LANGUAGES C +) + +set(SOURCE_DM src/dir_monitor.c) + +add_executable(dir_monitor ${SOURCE_DM}) + +add_executable(dir_monitor_debug ${SOURCE_DM}) +target_compile_options(dir_monitor_debug PUBLIC -g -DDEBUGBUILD) + +add_executable(dir_monitor_debug_asan ${SOURCE_DM}) +target_compile_options(dir_monitor_debug_asan PUBLIC -g -DDEBUGBUILD -fsanitize=address) +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) + + +# 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