-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
41 lines (30 loc) · 1.01 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.13)
project(
Lox-modern-cpp
VERSION 0.1
DESCRIPTION "Lox modern cpp implement"
LANGUAGES CXX)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(coverage)
include(update_submodules)
enable_testing()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} -DDOCTEST_CONFIG_DISABLE")
set(BENCHMARK_ENABLE_TESTING
OFF
CACHE BOOL "Suppressing benchmark's tests" FORCE)
set(BENCHMARK_DIR ${PROJECT_SOURCE_DIR}/tools/benchmark)
set(DOCTEST_DIR ${PROJECT_SOURCE_DIR}/tools/doctest)
add_subdirectory(tools)
configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h @ONLY)
add_subdirectory(benchmark)
add_subdirectory(src)
add_subdirectory(tests)
add_executable(lox main.cpp ${TESTS_SOURCES})
add_dependencies(lox doctest)
target_link_libraries(lox PUBLIC lox_core)
include(${DOCTEST_DIR}/scripts/cmake/doctest.cmake)
doctest_discover_tests(lox)