-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
42 lines (35 loc) · 1.46 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
cmake_minimum_required(VERSION 3.14...3.28)
project(felspar-coro LANGUAGES CXX)
enable_testing()
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
add_custom_target(felspar-check)
set_property(TARGET felspar-check PROPERTY EXCLUDE_FROM_ALL TRUE)
add_custom_target(felspar-examples)
include(requirements.cmake)
add_compile_options(
-fdiagnostics-color=always
-fdiagnostics-show-option
)
endif()
set(coro_opt)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
set(coro_opt "$<$<COMPILE_LANGUAGE:CXX>:-fcoroutines-ts;-Wno-deprecated-experimental-coroutine>")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(coro_opt "$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-experimental-coroutine>")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")
set(coro_opt "$<$<COMPILE_LANGUAGE:CXX>:-fcoroutines>")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(coro_opt "$<$<COMPILE_LANGUAGE:CXX>:-fcoroutines;-Wno-mismatched-new-delete>")
endif()
add_library(felspar-coro INTERFACE)
target_include_directories(felspar-coro INTERFACE include)
target_compile_features(felspar-coro INTERFACE cxx_std_20)
target_compile_options(felspar-coro INTERFACE ${coro_opt})
target_link_libraries(felspar-coro INTERFACE felspar-memory)
install(DIRECTORY include/felspar TYPE INCLUDE)
if(TARGET felspar-examples)
add_subdirectory(examples)
endif()
if(TARGET felspar-check)
add_subdirectory(test)
endif()