cmake_minimum_required(VERSION 3.15...4.0) project(dir_monitor LANGUAGES 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_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 -Werror) add_executable(dir_monitor_debug_asan ${SOURCE_DM}) 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})