forked from luncliff/coroutine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux.cmake
More file actions
52 lines (45 loc) · 1.16 KB
/
linux.cmake
File metadata and controls
52 lines (45 loc) · 1.16 KB
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
# ---------------------------------------------------------------------------
#
# Author : github.com/luncliff (luncliff@gmail.com)
#
# ---------------------------------------------------------------------------
if(NOT UNIX)
message(FATAL_ERROR "Expect UNIX platform. Current platform is ${CMAKE_SYSTEM}")
endif()
add_library(${PROJECT_NAME}
linux/dllmain.cpp
linux/event_poll.h
linux/event_poll.cpp
linux/event.cpp
posix/concrt.cpp
linux/net.cpp
net/resolver.cpp
)
target_compile_options(${PROJECT_NAME}
PUBLIC
-std=c++2a
-stdlib=libc++
-fcoroutines-ts -fPIC
PRIVATE
-Wall -Wno-unknown-pragmas -Wno-unused-private-field
-fvisibility=hidden -fno-rtti
-ferror-limit=5
)
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
# code coverage option lead to compiler crash
# list(APPEND CMAKE_CXX_FLAGS "--coverage")
target_compile_options(${PROJECT_NAME}
PRIVATE
-g -O0
)
else()
target_compile_options(${PROJECT_NAME}
PRIVATE
-O3
)
endif()
target_link_libraries(${PROJECT_NAME}
PUBLIC
pthread rt
c++ # c++abi c++experimental
)