-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (55 loc) · 1.43 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Arbitrary - We probably do not need any fancy functionality
cmake_minimum_required(VERSION 3.1)
project(laio)
set(CMAKE_CXX_STANDARD 17)
# Subdirectories
if(NOT TARGET windows_system_error)
add_subdirectory(dependencies/windows_system_error)
endif()
# Use GSL for access to spans
# TODO: Replace by STL span upon availability
if(NOT TARGET GSL)
add_subdirectory(dependencies/GSL)
endif()
# Use fmt for access to format
# TODO: Replace by STL format upon availability
if(NOT TARGET fmt)
add_subdirectory(dependencies/fmt)
endif()
if(NOT TARGET Catch2)
add_subdirectory(dependencies/Catch2)
endif()
# Collect public interfaces
set(laio_public_headers
${CMAKE_CURRENT_SOURCE_DIR}/include/interfaces.h
${CMAKE_CURRENT_SOURCE_DIR}/include/traits.h
)
# Build library
add_library(laio
INTERFACE
)
target_sources(laio
INTERFACE
"$<BUILD_INTERFACE:${laio_public_headers}>"
)
target_include_directories(laio
INTERFACE
include
)
add_subdirectory(src/laio_iocp)
add_subdirectory(src/laio_net)
target_link_libraries(laio
INTERFACE
windows_system_error
GSL
fmt
laio_iocp
laio_net
)
# Build tests
add_executable(test_laio
test/testmain.cpp
test/test_laio_iocp.cpp
test/test_laio_net.cpp
)
target_link_libraries(test_laio windows_system_error Catch2 laio)