aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Töpper <atsutane@freethoughts.de>2025-06-14 17:44:25 +0200
committerThorsten Töpper <atsutane@freethoughts.de>2025-06-14 17:44:25 +0200
commitf84da1cfee5a5fe63843b3e4420dadea824df132 (patch)
treed13d59aa840455bdbbdb9fbccda39366565ad587
parent42ba755c425682f1f54fdb40a39227035e833cfd (diff)
downloaddir_monitor-f84da1cfee5a5fe63843b3e4420dadea824df132.tar.gz
dir_monitor-f84da1cfee5a5fe63843b3e4420dadea824df132.tar.bz2
Switch to cmake
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt30
-rw-r--r--Makefile.old (renamed from Makefile)0
3 files changed, 31 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index e660fd9..36f971e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-bin/
+bin/*
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
diff --git a/Makefile b/Makefile.old
index e449e10..e449e10 100644
--- a/Makefile
+++ b/Makefile.old