mirror of
https://gitlab.com/niansa/libcrosscoro.git
synced 2025-03-06 20:53:32 +01:00
48 lines
1.6 KiB
CMake
48 lines
1.6 KiB
CMake
cmake_minimum_required(VERSION 3.0)
|
|
project(libcrosscoro CXX)
|
|
|
|
set(CARES_STATIC ON CACHE INTERNAL "")
|
|
set(CARES_SHARED OFF CACHE INTERNAL "")
|
|
set(CARES_INSTALL OFF CACHE INTERNAL "")
|
|
|
|
set(LIBCROSSCORO_SOURCE_FILES
|
|
inc/coro/concepts/awaitable.hpp
|
|
inc/coro/concepts/buffer.hpp
|
|
inc/coro/concepts/executor.hpp
|
|
inc/coro/concepts/promise.hpp
|
|
inc/coro/concepts/range_of.hpp
|
|
|
|
inc/coro/detail/void_value.hpp
|
|
|
|
inc/coro/coro.hpp
|
|
inc/coro/event.hpp src/event.cpp
|
|
inc/coro/fd.hpp
|
|
inc/coro/generator.hpp
|
|
inc/coro/latch.hpp
|
|
inc/coro/mutex.hpp src/mutex.cpp
|
|
inc/coro/ring_buffer.hpp
|
|
inc/coro/semaphore.hpp src/semaphore.cpp
|
|
inc/coro/shared_mutex.hpp
|
|
inc/coro/stop_signal.hpp
|
|
inc/coro/sync_wait.hpp src/sync_wait.cpp
|
|
inc/coro/task_container.hpp
|
|
inc/coro/task.hpp
|
|
inc/coro/thread_pool.hpp src/thread_pool.cpp
|
|
inc/coro/when_all.hpp
|
|
)
|
|
|
|
add_library(crosscoro STATIC ${LIBCROSSCORO_SOURCE_FILES})
|
|
set_target_properties(crosscoro PROPERTIES LINKER_LANGUAGE CXX)
|
|
target_compile_features(crosscoro PUBLIC cxx_std_20)
|
|
target_include_directories(crosscoro PUBLIC inc)
|
|
target_link_libraries(crosscoro PUBLIC pthread)
|
|
|
|
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.2.0")
|
|
message(FATAL_ERROR "gcc version ${CMAKE_CXX_COMPILER_VERSION} is unsupported, please upgrade to at least 10.2.0")
|
|
endif()
|
|
|
|
target_compile_options(crosscoro PUBLIC -fcoroutines -Wall -Wextra -pipe)
|
|
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
|
message(FATAL_ERROR "Clang is currently not supported.")
|
|
endif()
|