20 lines
546 B
CMake
20 lines
546 B
CMake
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)
|