forked from WanderPig/SigSlot
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
48 lines (44 loc) · 1.21 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
cmake_minimum_required(VERSION 3.13)
project(sigslot)
# GoogleTest requires at least C++14, coroutines need C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
FetchContent_MakeAvailable(googletest)
enable_testing()
link_libraries(GTest::gtest_main)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(sigslot-test
test/sigslot.cc
test/coroutine.cc
sigslot/sigslot.h
sigslot/tasklet.h
sigslot/resume.h
)
add_executable(sigslot-test-resume
sigslot/sigslot.h
sigslot/tasklet.h
test/resume.cc
sigslot/resume.h
)
add_executable(sigslot-test-cothread
sigslot/sigslot.h
sigslot/tasklet.h
test/cothread.cc
sigslot/resume.h
sigslot/cothread.h
)
include(GoogleTest)
gtest_discover_tests(sigslot-test)
gtest_discover_tests(sigslot-test-resume)
gtest_discover_tests(sigslot-test-cothread)
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")
endif ()
if (WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /await")
endif()