-
Notifications
You must be signed in to change notification settings - Fork 526
/
CMakeLists.txt
41 lines (30 loc) · 1.29 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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Base target for all other targets. Ensures all arguments required are correctly set
add_library(inc INTERFACE)
target_compile_options(inc INTERFACE ${QUIC_C_FLAGS})
target_compile_options(inc INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${QUIC_CXX_FLAGS}>)
target_compile_definitions(inc INTERFACE ${QUIC_COMMON_DEFINES})
target_include_directories(inc INTERFACE ${QUIC_INCLUDE_DIR})
target_compile_features(inc INTERFACE cxx_std_17)
target_compile_features(inc INTERFACE c_std_11)
if (HAS_GUARDCF)
target_link_options(inc INTERFACE /guard:cf /DYNAMICBASE)
endif()
if (NOT MSVC AND QUIC_ENABLE_SANITIZERS)
target_link_libraries(inc INTERFACE -fsanitize=address,leak,undefined)
endif()
if (NOT MSVC AND NOT APPLE AND NOT ANDROID)
find_library(ATOMIC NAMES atomic libatomic.so.1)
if (ATOMIC)
message(STATUS "Found libatomic: ${ATOMIC}")
endif()
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(inc INTERFACE Threads::Threads ${CMAKE_DL_LIBS} ${ATOMIC})
if(WIN32)
target_link_libraries(inc INTERFACE ws2_32 schannel ntdll bcrypt ncrypt crypt32 iphlpapi advapi32)
endif()
add_library(warnings INTERFACE)
target_compile_options(warnings INTERFACE ${QUIC_WARNING_FLAGS})