-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
58 lines (48 loc) · 1.5 KB
/
CMakeLists.txt
File metadata and controls
58 lines (48 loc) · 1.5 KB
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
# gersemi: off
# examples/CMakeLists.txt -*-makefile-*-
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# gersemi: on
cmake_minimum_required(VERSION 3.30...4.3)
include(../cmake/prelude.cmake)
project(beman_execution.example LANGUAGES CXX)
if(PROJECT_IS_TOP_LEVEL)
include(../cmake/cxx-modules-rules.cmake)
find_package(beman.execution 0.3.0 EXACT REQUIRED)
enable_testing()
endif()
set(TODO stop_token) #-dk:TODO including that causes a linker error
set(TODO suspend_never) #-dk:TODO including that causes ASAN errors
set(EXAMPLES
allocator
doc-just
doc-just_error
doc-just_stopped
inspect
intro-1-hello-world
intro-2-hello-async
intro-5-consumer
playground
sender-demo
stackoverflow
stopping
when_all-cancel
)
if(BEMAN_USE_MODULES)
#-dk:TODO gcc doesn't like the modules: list(APPEND EXAMPLES modules modules-and-header)
list(APPEND EXAMPLES modules-and-header)
endif()
foreach(EXAMPLE ${EXAMPLES})
set(EXAMPLE_TARGET ${PROJECT_NAME}.${EXAMPLE})
add_executable(${EXAMPLE_TARGET})
target_sources(${EXAMPLE_TARGET} PRIVATE ${EXAMPLE}.cpp)
if(BEMAN_USE_MODULES)
target_compile_definitions(${EXAMPLE_TARGET} PUBLIC BEMAN_HAS_MODULES)
target_link_libraries(${EXAMPLE_TARGET} PRIVATE beman::execution)
else()
target_link_libraries(
${EXAMPLE_TARGET}
PRIVATE beman::execution_headers
)
endif()
add_test(NAME ${EXAMPLE_TARGET} COMMAND ${EXAMPLE_TARGET})
endforeach()