-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
86 lines (59 loc) · 1.76 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
78
79
80
81
82
83
84
85
86
project(tainter)
cmake_minimum_required(VERSION 2.8)
find_package(LLVM 10.0.0 REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
# Needed to use support library
# -fno-rtti -I/usr/local/boost
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++14")
message(STATUS "Found LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}")
include_directories(${LLVM_INCLUDE_DIRS})
message(STATUS "Found LLVM_DEFINITIONS ${LLVM_DEFINITIONS}")
add_definitions(${LLVM_DEFINITIONS})
set(LLVM_LINK_COMPONENTS
Core
ExecutionEngine
Interpreter
MC
Support
nativecodegen
mcjit
X86
asmparser
objcarcopts
scalaropts
transformutils
irreader
)
add_executable(tainter
tainter.cpp
# explore.cpp
)
llvm_map_components_to_libnames(llvm_libs ${LLVM_LINK_COMPONENTS})
#find_package(Boost 1.73.0 COMPONENTS serialization)
#include_directories(${Boost_INCLUDE_DIRS})
#link_directories(${Boost_LIBRARY_DIRS})
#if(Boost_FOUND)
# set(Boost_INCLUDE_DIRS /usr/local/include)
# set(Boost_LIBRARY_DIRS /usr/local/lib)
# message(STATUS "Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS}")
# message(STATUS "Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS}")
#link llvm component
# message(STATUS "Found llvm_libs ${llvm_libs}")
# target_link_libraries(tainter ${llvm_libs} Boost::serialization)
# target_link_libraries(tainter
# pthread
# tinfo
# dl
# ${llvm_libs}
# )
#else()
#link llvm component
message(STATUS "Found llvm_libs ${llvm_libs}")
target_link_libraries(tainter ${llvm_libs})
target_link_libraries(tainter
pthread
dl
${llvm_libs}
)
#endif()