-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
46 lines (36 loc) · 1.08 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
# CMakeList.txt : CMake project for restorer, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.8)
set(projectname "restorer")
project (${projectname})
set(SOURCES
src/main.cpp
src/restorer.h
src/restorer.cpp
src/rtti.h
src/rtti.cpp
)
# Add source to this project's executable.
add_executable (${projectname} ${SOURCES})
target_compile_features(${projectname} PRIVATE cxx_std_17)
#######################
# LLVM
find_package(LLVM CONFIG REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(HandleLLVMOptions)
add_definitions(${LLVM_DEFINITIONS})
target_include_directories(${projectname} PRIVATE ${LLVM_INCLUDE_DIRS})
# Find the libraries that correspond to the LLVM components that we wish to use
llvm_map_components_to_libnames(
llvm_libs Support Core object demangle
DebugInfoCodeView
DebugInfoMSF
DebugInfoPDB
)
IF(MSVC)
SET_TARGET_PROPERTIES(${projectname} PROPERTIES COMPILE_FLAGS "/EHsc")
ENDIF(MSVC)
# Link against LLVM libraries
target_link_libraries(${projectname} PRIVATE ${llvm_libs})
#######################