-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
77 lines (60 loc) · 1.82 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
76
77
cmake_minimum_required(VERSION 3.22)
# Enable IDE folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Force x86_64 architecture on MacOSX
if(APPLE)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
# Disable deprecation warnings
add_compile_options(
-Wno-deprecated-declarations
)
endif()
# Allow CMake find custom package finders
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the current working branch
if(NOT DEFINED GIT_BRANCH)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
file(STRINGS "VERSION" GM_MOONLOADER_VERSION)
project(gm_moonloader
VERSION ${GM_MOONLOADER_VERSION}
LANGUAGES CXX C
HOMEPAGE_URL "https://github.com/Pika-Software/gm_moonloader"
)
# Require C++ 17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Enable -fPIC flag
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Debug build is unsupported on MSVC
if(MSVC)
list(REMOVE_ITEM CMAKE_CONFIGURATION_TYPES "Debug")
endif()
# Force old ABI for Linux, since Garry's Mod ABI is used
if(UNIX AND NOT APPLE)
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
endif()
# Include extensions
add_subdirectory(cmake)
# Entropia File System Watcher
add_subdirectory(third-party/efsw)
# Include embedded lua
# add_subdirectory(third-party/lua)
add_subdirectory(third-party/lpeg)
# Add moonengine library
add_subdirectory(moonengine)
# Include garrysmod_common
find_package(GarrysmodCommon REQUIRED)
add_subdirectory(source)