-
Notifications
You must be signed in to change notification settings - Fork 81
/
CMakeLists.txt
45 lines (38 loc) · 1.24 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
cmake_policy(SET CMP0091 NEW)
project(libarcus)
cmake_minimum_required(VERSION 3.23)
find_package(standardprojectsettings REQUIRED)
find_package(protobuf REQUIRED)
option(ENABLE_SENTRY "Send crash data via Sentry" OFF)
set(arcus_SRCS
src/Socket.cpp
src/SocketListener.cpp
src/MessageTypeStore.cpp
src/PlatformSocket.cpp
src/Error.cpp
)
if(BUILD_SHARED_LIBS)
add_library(Arcus SHARED ${arcus_SRCS})
else()
add_library(Arcus STATIC ${arcus_SRCS})
endif()
set_project_warnings(Arcus)
enable_sanitizers(Arcus)
use_threads(Arcus)
target_include_directories(Arcus
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
)
target_link_libraries(Arcus PUBLIC protobuf::libprotobuf)
if(WIN32)
target_compile_definitions(Arcus PRIVATE -D_WIN32_WINNT=0x0600)
# Declare we require Vista or higher, this allows us to use IPv6 functions.
target_link_libraries(Arcus PUBLIC Ws2_32)
set_target_properties(Arcus PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (ENABLE_SENTRY)
set_target_properties(Arcus PROPERTIES LINK_FLAGS "/DEBUG:FULL")
endif ()
endif()