aboutsummaryrefslogtreecommitdiff
path: root/core/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'core/CMakeLists.txt')
-rw-r--r--core/CMakeLists.txt57
1 files changed, 57 insertions, 0 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
new file mode 100644
index 0000000..785421c
--- /dev/null
+++ b/core/CMakeLists.txt
@@ -0,0 +1,57 @@
+set(COMPONENT "core")
+
+# Library
+
+add_library("${COMPONENT}"
+ "src/disposition.cpp"
+ "src/participant.cpp"
+ "src/turn_order.cpp"
+)
+
+add_library("turns::${COMPONENT}" ALIAS "${COMPONENT}")
+
+
+target_compile_options("${COMPONENT}" 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>"
+ PRIVATE
+ "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:-fprofile-arcs>"
+ "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:-ftest-coverage>"
+)
+
+target_include_directories("${COMPONENT}" PUBLIC
+ "include"
+)
+
+target_link_libraries("${COMPONENT}" PUBLIC
+ "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:gcov>"
+
+ "PkgConfig::giomm"
+ "PkgConfig::glibmm"
+)
+
+target_link_options("${COMPONENT}" PRIVATE
+ "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:--coverage>"
+)
+
+# Tests
+
+add_executable("${COMPONENT}-tests"
+ "tests/register_types.cpp"
+
+ "tests/disposition.cpp"
+ "tests/participant.cpp"
+ "tests/turn_order_bugs.cpp"
+ "tests/turn_order.cpp"
+)
+
+target_link_libraries("${COMPONENT}-tests"
+ "Catch2::Catch2"
+
+ "turns::core"
+ "turns::glib-test-main"
+)
+
+catch_discover_tests("${COMPONENT}-tests") \ No newline at end of file