Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with system LLVM #684

Merged
merged 1 commit into from
Aug 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,22 @@ find_package(Z3 CONFIG REQUIRED)

# LLVM
find_package(LLVM CONFIG REQUIRED)
llvm_map_components_to_libnames(llvm_libs
support core irreader
bitreader bitwriter
passes asmprinter
aarch64info aarch64desc aarch64codegen aarch64asmparser
armcodegen armasmparser
interpreter mcjit
nvptxdesc
x86info x86codegen x86asmparser
sparccodegen sparcasmparser
webassemblydesc)
# https://github.com/JonathanSalwan/Triton/issues/1082#issuecomment-1030826696
if(LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
else()
llvm_map_components_to_libnames(llvm_libs
support core irreader
bitreader bitwriter
passes asmprinter
aarch64info aarch64desc aarch64codegen aarch64asmparser
armcodegen armasmparser
interpreter mcjit
nvptxdesc
x86info x86codegen x86asmparser
sparccodegen sparcasmparser
webassemblydesc)
endif()
message(STATUS "LLVM Libraries: ${llvm_libs}")

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
Expand Down Expand Up @@ -85,6 +90,7 @@ find_package(XED CONFIG REQUIRED)
find_package(glog CONFIG REQUIRED)

# Google gflags
set(GFLAGS_USE_TARGET_NAMESPACE ON)
find_package(gflags CONFIG REQUIRED)

set(sleigh_ENABLE_TESTS OFF)
Expand Down Expand Up @@ -131,7 +137,9 @@ add_library(remill_settings INTERFACE)

target_include_directories(remill_settings INTERFACE
$<BUILD_INTERFACE:${REMILL_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${LLVM_INCLUDE_DIR}>
)

if(WIN32)
# warnings and compiler settings
Expand Down
Loading