forked from EKA2L1/EKA2L1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
75 lines (58 loc) · 2.1 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
cmake_minimum_required(VERSION 3.13)
project (EKA2L1)
# Clang 14 is required to compile nicely with C++ 20
set (CMAKE_CXX_STANDARD 20)
option(EKA2L1_BUILD_TOOLS "Build EKA2L1's tool" ON)
option(EKA2L1_BUILD_TESTS "Build EKA2L1's tests" ON)
option(EKA2L1_ENABLE_SCRIPTING_ABILITY "Enable to script with Python or Lua" ON)
option(EKA2L1_ENABLE_UNEXPECTED_EXCEPTION_HANDLER "Enable EKA2L1 to dump unexpected exception" OFF)
option(EKA2L1_BUILD_VULKAN_BACKEND "Build Vulkan backend" OFF)
option(EKA2L1_DEPLOY_DMG "Deploy EKA2L1 as .dmg" OFF)
option(EKA2L1_BUILD_PATCH "Enable building Symbian's DLL patches using Symbian SDK" OFF)
option(EKA2L1_ENABLE_DISCORD_RICH_PRESENCE "Enable support for Discord Rich Presence" OFF)
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set (ROOT ${CMAKE_CURRENT_SOURCE_DIR})
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
message("Using CCache for building")
endif()
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-D_DISABLE_VECTOR_ANNOTATION)
endif(MSVC)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-error)
endif()
if (EKA2L1_BUILD_VULKAN_BACKEND)
set (BUILD_WITH_VULKAN 1)
else()
set (BUILD_WITH_VULKAN 0)
endif()
if (EKA2L1_ENABLE_SCRIPTING_ABILITY)
set (ENABLE_SCRIPTING 1)
endif(EKA2L1_ENABLE_SCRIPTING_ABILITY)
if (CI)
set (BUILD_FOR_USER 1)
endif (CI)
set (ENABLE_SEH_HANDLER 0)
if (EKA2L1_ENABLE_UNEXPECTED_EXCEPTION_HANDLER)
set(ENABLE_SEH_HANDLER 1)
endif (EKA2L1_ENABLE_UNEXPECTED_EXCEPTION_HANDLER)
if (EKA2L1_ENABLE_DISCORD_RICH_PRESENCE AND NOT ANDROID AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
set(ENABLE_DISCORD_RICH_PRESENCE 1)
else()
set(ENABLE_DISCORD_RICH_PRESENCE 0)
endif()
add_subdirectory(src/patch)
add_subdirectory(src/external)
add_subdirectory(src/emu)
if (EKA2L1_BUILD_TOOLS)
add_subdirectory(src/tools)
endif()
if (EKA2L1_BUILD_TESTS)
enable_testing()
add_subdirectory(src/tests)
endif()