forked from microsoft/llvm-mctoll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (48 loc) · 1.39 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
if(NOT (LLVM_TARGETS_TO_BUILD MATCHES "X86" OR LLVM_TARGETS_TO_BUILD MATCHES "ARM"))
return()
endif()
set(LLVM_MCTOLL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LLVM_MCTOLL_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
llvm_map_components_to_libnames(llvm_libs
${LLVM_TARGETS_TO_BUILD}
DebugInfoDWARF
DebugInfoPDB
Symbolize
)
set(LLVM_MCTOLL_LIB_DEPS ${llvm_libs})
set(LLVM_MCTOLL_SUPPORTED_ARCHS "")
if(LLVM_TARGETS_TO_BUILD MATCHES "X86")
set(LLVM_MCTOLL_SUPPORTED_ARCHS
"${LLVM_MCTOLL_SUPPORTED_ARCHS}MODULE_RAISER(X86)\n")
add_subdirectory(X86)
list(APPEND LLVM_MCTOLL_LIB_DEPS X86Raiser)
endif()
if(LLVM_TARGETS_TO_BUILD MATCHES "ARM")
set(LLVM_MCTOLL_SUPPORTED_ARCHS
"${LLVM_MCTOLL_SUPPORTED_ARCHS}MODULE_RAISER(ARM)\n")
add_subdirectory(ARM)
list(APPEND LLVM_MCTOLL_LIB_DEPS ARMRaiser)
endif()
configure_file(
${LLVM_MCTOLL_SOURCE_DIR}/Raisers.def.in
${LLVM_INCLUDE_DIR}/Raisers.def
)
add_subdirectory(test)
add_llvm_tool(llvm-mctoll
llvm-mctoll.cpp
COFFDump.cpp
ELFDump.cpp
ExternalFunctions.cpp
MachODump.cpp
WasmDump.cpp
MachineFunctionRaiser.cpp
MCInstOrData.cpp
MCInstRaiser.cpp
EmitRaisedOutputPass.cpp
)
# Link against LLVM libraries and target-specific Raiser libraries
target_link_libraries(llvm-mctoll PRIVATE ${LLVM_MCTOLL_LIB_DEPS})
if(HAVE_LIBXAR)
message(STATUS "Linking xar")
target_link_libraries(llvm-mctoll PRIVATE ${XAR_LIB})
endif()