-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
36 lines (27 loc) · 939 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
cmake_minimum_required(VERSION 3.16)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif ()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
project(asyncio)
add_subdirectory(third_party/fmt)
option(WITH_IO "With Linux IO Support." ON)
if (NOT (UNIX AND NOT APPLE)) # NOT LINUX
# If cmake version is high, use LINUX directly. (https://cmake.org/cmake/help/latest/variable/LINUX.html)
set(WITH_IO OFF)
endif ()
add_library(asyncio include/asyncio/asyncio.h src/handle.cpp)
target_include_directories(asyncio PUBLIC include)
target_link_libraries(asyncio PUBLIC fmt::fmt)
if (NOT WITH_IO)
message(WARNING "IO is disabled.")
target_compile_definitions(asyncio PUBLIC NO_IO)
endif ()
add_subdirectory(src_main)
option(WITH_CATCH2 "With Catch2 Test." ON)
if (WITH_CATCH2)
add_subdirectory(third_party/Catch2)
add_subdirectory(src_main/catch2)
endif ()