aboutsummaryrefslogtreecommitdiff
path: root/src/client/CMakeLists.txt
blob: e6994abc1e47aca56fb980d2803c6be2737476eb (plain)
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
cmake_minimum_required(VERSION 3.18)

project(blockgame_linux)

file (GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS
    "*.cc"
)
file (GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS
    "*.hh"
    "../server/*.hh"
    "../shared/*.hh"
)
add_executable(${PROJECT_NAME}
    ${SOURCE_FILES}
)

find_library(LIB_SDL2 sdl2 SDL2 REQUIRED)
find_library(LIB_EPOXY epoxy epoxy EPOXY libepoxy REQUIRED)
find_library(LIB_SQLITE3 sqlite3 SQLITE3 REQUIRED)
find_library(LIB_FREETYPE freetype libfreetype REQUIRED)
find_library(LIB_ASSIMP assimp libassimp REQUIRED)
find_library(LIB_PROTOBUF protobuf libprotobuf REQUIRED)
find_package(Boost COMPONENTS iostreams REQUIRED)
find_package(Threads REQUIRED)
find_package(Backtrace REQUIRED)
find_package(Freetype REQUIRED)

target_compile_options(${PROJECT_NAME} PRIVATE
    -Wall -Wextra -Wshadow -Wdouble-promotion -Wformat=2 -Wundef -fno-common
    -Wconversion -Wpedantic -std=c++20 -O2
    -Wno-exceptions
    -Wno-missing-field-initializers -Wno-unknown-pragmas
)
target_compile_options(${PROJECT_NAME} PRIVATE
    -fstack-protector-strong -fno-omit-frame-pointer #-fsanitize=undefined -fsanitize-trap=undefined
)
target_link_options(${PROJECT_NAME} PRIVATE
    -fstack-protector-strong #-fsanitize=undefined -fsanitize-trap=undefined
)
target_include_directories(${PROJECT_NAME} PRIVATE
    "../../src"
    ${FREETYPE_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
    ${LIB_SDL2}
    ${LIB_EPOXY}
    ${LIB_FREETYPE}
    ${LIB_ASSIMP}
    ${LIB_PROTOBUF}
    ${LIB_SQLITE3}
    ${Backtrace_LIBRARIES}
    ${Threads_LIBRARIES}
    ${Boost_LIBRARIES}
    ${FREETYPE_LIBRARIES}
    shared
    server
)
target_precompile_headers(${PROJECT_NAME} PRIVATE
    ${HEADER_FILES}
)