-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
59 lines (50 loc) · 1.63 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
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0077 NEW)
cmake_policy(SET CMP0091 NEW)
cmake_policy(SET CMP0092 NEW)
project(SPMod
VERSION 0.3.0
DESCRIPTION "Scripting Engine for HL1"
HOMEPAGE_URL "https://github.com/Amaroq7/SPMod"
LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(BUILD_DYNAMIC "Build SPMod as dynamically linked library" ON)
option(BUILD_SPADAPTER "Build SourcePawn adapter" ON)
option(BUILD_EXAMPLE "Build example adapter" OFF)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CLANG_MINIMUM_VERSION "10.0.0")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS CLANG_MINIMUM_VERSION)
message(WARNING "Building LLVM for clang older than ${CLANG_MINIMUM_VERSION} is not supported. Using GCC backend instead...")
set(LLVM_BUILD OFF)
else()
include(cmake/BuildLLVM.cmake)
endif()
endif()
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wpedantic -pedantic-errors")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -O0")
else()
if (NOT BUILD_DYNAMIC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
endif()
if (UNIX)
if (LLVM_BUILD)
include(cmake/BuildYAMLClang.cmake)
else()
include(cmake/BuildYAMLGCC.cmake)
endif()
else()
include(cmake/BuildYAMLMSVC.cmake)
endif()
add_subdirectory(src spmod)
add_subdirectory(subprojects)
# install scripts
install(
DIRECTORY scripting
DESTINATION .
)