-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
39 lines (25 loc) · 985 Bytes
/
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
cmake_minimum_required(VERSION 3.25)
project(iocp)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
if(CMAKE_GENERATOR MATCHES "Ninja")
set(CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY "<CMAKE_AR> /OUT:<TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
option(WITHOUT_IOURING "use epoll/poll/kqueue to support IOCP. not io_uring" OFF)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-ffunction-sections)
endif()
if (NOT WIN32)
find_package(IOUring)
if (IOUring_FOUND AND NOT WITHOUT_IOURING)
link_libraries(${IOUring_LIBRARY})
add_subdirectory(iocp4linux)
else(IOUring_FOUND AND NOT WITHOUT_IOURING)
add_subdirectory(iocp_asio)
endif(IOUring_FOUND AND NOT WITHOUT_IOURING)
endif()
add_subdirectory(uasync)
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(example)
endif()