Replace build scripts with CMake

Rebuilding everything each time was getting a bit slow.
This commit is contained in:
2024-10-27 00:12:17 +01:00
parent 403d081e13
commit c58cabd2e6
6 changed files with 66 additions and 45 deletions

19
CMakeLists.txt Normal file
View File

@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.10)
project(regex-engine LANGUAGES C)
option(SANITIZERS "Enable address and UB sanitizers")
enable_testing()
function(set_default_target_options target)
set_property(TARGET ${target} PROPERTY C_STANDARD 11)
target_compile_options(${target} PRIVATE -Wall -Wextra -pedantic)
if(${SANITIZERS})
target_compile_options(${target} PRIVATE -fsanitize=address,undefined)
target_link_options(${target} PRIVATE -fsanitize=address,undefined)
endif()
endfunction()
add_subdirectory(lib)
add_subdirectory(tests)