-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
71 lines (55 loc) · 1.14 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.15)
set(VERSION 1.0.0)
project(
catan_engine
VERSION ${VERSION}
)
file(GLOB_RECURSE src src/*.cpp)
file(GLOB_RECURSE tests tests/*.cpp)
set (CMAKE_CXX_STANDARD 20)
if(MSVC)
add_compile_options("/WX" "$<$<CONFIG:RELEASE>:/O2>")
else()
add_compile_options("-Wall" "-Wextra" "-Werror" "$<$<CONFIG:RELEASE>:-O3>")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# add_compile_options("-stdlib=libc++")
endif()
endif()
# Application
add_library(
catan_engine_lib
${src}
)
target_include_directories(
catan_engine_lib
PUBLIC
include/
)
# Testing
add_subdirectory(
lib/google_test
)
# add_subdirectory(
# lib/google_fuzztest
# )
enable_testing()
add_executable(
catan_engine_unit_tests ${tests}
)
target_link_libraries(
catan_engine_unit_tests PUBLIC
gtest_main catan_engine_lib
)
target_include_directories(
catan_engine_unit_tests PUBLIC
${gtest_SOURCE_DIR}/include
${gmock_SOURCE_DIR}/include
)
target_include_directories(
catan_engine_unit_tests
PUBLIC
include/
)
add_test(
unit_tests catan_engine_unit_tests
)