Replace build scripts with CMake
Rebuilding everything each time was getting a bit slow.
This commit is contained in:
19
CMakeLists.txt
Normal file
19
CMakeLists.txt
Normal 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)
|
||||
Reference in New Issue
Block a user