26 lines
516 B
CMake
26 lines
516 B
CMake
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(imp LANGUAGES C)
|
|
|
|
option(TESTS "Build tests" ON)
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
function(configure_target target)
|
|
# Set C standard and compile flags
|
|
set_target_properties(${target} PROPERTIES
|
|
C_STANDARD 11
|
|
C_STANDARD_REQUIRED ON
|
|
C_EXTENSIONS OFF
|
|
)
|
|
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic)
|
|
endfunction()
|
|
|
|
add_subdirectory(lib)
|
|
|
|
if (${TESTS})
|
|
enable_testing()
|
|
add_subdirectory(dep/unity)
|
|
add_subdirectory(tests)
|
|
endif()
|