-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
55 lines (43 loc) · 1.48 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
cmake_minimum_required(VERSION 3.16)
# SpadesX
project(SpadesX)
# Find pthread
find_package(Threads REQUIRED)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
option(CMAKE_UNITY_BUILD "Enable Unity Build" ON)
# Add third party libraries
add_subdirectory(Extern)
# Add main target
add_compile_options(-Wall -Wextra -Werror -Wpedantic -Wno-error=unused-but-set-parameter -Wno-error=pedantic -std=gnu11 -fstack-protector-strong -fsanitize=undefined -fsanitize=address)
add_executable(SpadesX "")
target_link_libraries(SpadesX
PRIVATE
Server
Util
enet
mapvxl
m
json-c
readline
Threads::Threads
-fsanitize=undefined
-fsanitize=address
)
if (UNIX)
target_link_libraries(SpadesX PRIVATE bsd)
endif()
add_subdirectory(Source)
set_target_properties(SpadesX Util Server
PROPERTIES
INTERPROCEDURAL_OPTIMIZATION true
)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/config.json)
configure_file(${PROJECT_SOURCE_DIR}/Resources/config.json ${CMAKE_BINARY_DIR}/config.json COPYONLY)
endif()
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Border_Hallway.vxl)
configure_file(${PROJECT_SOURCE_DIR}/Resources/Border_Hallway.vxl ${CMAKE_BINARY_DIR}/Border_Hallway.vxl COPYONLY)
endif()
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Border_Hallway.json)
configure_file(${PROJECT_SOURCE_DIR}/Resources/Border_Hallway.json ${CMAKE_BINARY_DIR}/Border_Hallway.json COPYONLY)
endif()