Add support for experimental LLVM.dll

This commit is contained in:
Duncan Ogilvie
2026-05-12 13:13:53 +02:00
parent 547aeefffb
commit 08b7d32c68
+11
View File
@@ -90,6 +90,17 @@ endif()
# Split the definitions properly (https://weliveindetail.github.io/blog/post/2017/07/17/notes-setup.html)
separate_arguments(LLVM_DEFINITIONS)
# Support dynamically-linked LLVM.dll (experimental)
if(WIN32 AND EXISTS "${LLVM_TOOLS_BINARY_DIR}/LLVM.dll" AND NOT TARGET LLVM)
find_library(LLVM_LIB LLVM PATHS ${LLVM_LIBRARY_DIRS} NO_DEFAULT_PATH NO_CACHE REQUIRED)
add_library(LLVM SHARED IMPORTED)
set_target_properties(LLVM PROPERTIES
IMPORTED_IMPLIB "${LLVM_LIB}"
IMPORTED_LOCATION "${LLVM_TOOLS_BINARY_DIR}/LLVM.dll"
)
# set(LLVM_LINK_LLVM_DYLIB ON) # TODO: this does not work
endif()
# https://github.com/JonathanSalwan/Triton/issues/1082#issuecomment-1030826696
if(LLVM_LINK_LLVM_DYLIB)
set(LLVM-Wrapper_LIBS LLVM)