-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
71 lines (60 loc) · 1.85 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
cmake_minimum_required(VERSION 3.5)
include("3rd/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.251.tar.gz"
SHA1 "5659b15dc0884d4b03dbd95710e6a1fa0fc3258d"
)
project(angelscript-llvm LANGUAGES CXX)
hunter_add_package(fmt)
find_package(fmt CONFIG REQUIRED)
if(DEFINED ENABLE_TESTING)
hunter_add_package(Catch)
find_package(Catch2 CONFIG REQUIRED)
endif()
add_library(angelscript-llvm
src/asllvm/detail/ashelper.cpp
src/asllvm/detail/assert.cpp
src/asllvm/detail/builder.cpp
src/asllvm/detail/debuginfo.cpp
src/asllvm/detail/functionbuilder.cpp
src/asllvm/detail/jitcompiler.cpp
src/asllvm/detail/llvmglobals.cpp
src/asllvm/detail/modulebuilder.cpp
src/asllvm/detail/modulecommon.cpp
src/asllvm/detail/modulemap.cpp
src/asllvm/detail/runtime.cpp
src/asllvm/detail/stackframe.cpp
src/asllvm/jit.cpp
)
if(NOT DEFINED ANGELSCRIPT_SDK_DIRECTORY)
message(
FATAL_ERROR
"CMake variable ANGELSCRIPT_SDK_DIRECTORY must be specified to the sdk/ directory of your AS installation"
)
endif()
if(NOT IS_DIRECTORY "${ANGELSCRIPT_SDK_DIRECTORY}/angelscript/source")
message(
FATAL_ERROR
"CMake variable ANGELSCRIPT_SDK_DIRECTORY does not appear to be valid: (path)/angelscript/source is not a directory"
)
endif()
target_compile_features(angelscript-llvm PUBLIC cxx_std_17)
target_include_directories(angelscript-llvm PRIVATE include/
${ANGELSCRIPT_SDK_DIRECTORY}/angelscript/source
${ANGELSCRIPT_SDK_DIRECTORY}/angelscript/include
)
target_link_libraries(angelscript-llvm
angelscript pthread
fmt::fmt
LLVM
)
# TODO: enable only on gcc AND clang
target_compile_options(angelscript-llvm PUBLIC
"-fno-strict-aliasing"
"-Wall"
"-Wextra"
)
add_subdirectory(3rd)
if(DEFINED ENABLE_TESTING)
add_subdirectory(tests/)
endif()