aboutsummaryrefslogtreecommitdiff
path: root/core/CMakeLists.txt
blob: 245c7f7852b83f775c4692af33d25e0ab8e8ddb9 (plain)
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
# Library

add_library("core"
  "src/disposition.cpp"
  "src/init.cpp"
  "src/participant.cpp"
  "src/turn_order.cpp"
)

add_library("turns::core" ALIAS "core")

target_compile_options("core" PUBLIC
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wall>"
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wextra>"
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-Werror>"
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-pedantic-errors>"
)

target_include_directories("core" PUBLIC
  "include"
)

target_link_libraries("core" PUBLIC
  "PkgConfig::giomm"
  "PkgConfig::glibmm"
)

enable_coverage("core")

# Tests

add_executable("core-tests"
  "tests/register_types.cpp"

  "tests/disposition.cpp"
  "tests/participant.cpp"
  "tests/turn_order_bugs.cpp"
  "tests/turn_order.cpp"
)

target_link_libraries("core-tests" PRIVATE
  "Catch2::Catch2"

  "turns::core"
  "turns::glib-test-main"
)

target_link_options("core-tests" PRIVATE
  "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:--coverage>"
)

catch_discover_tests("core-tests")