mirror of
https://github.com/LLVMParty/llvm-nanobind
synced 2026-06-21 13:43:38 +00:00
Add support for experimental LLVM.dll
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user