File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,7 +157,17 @@ if (WITH_LLVM)
157157 add_definitions ("-DHAVE_TARGET_X86=1" )
158158 endif ()
159159
160- llvm_map_components_to_libnames (llvm_libs ${LPYTHON_LLVM_COMPONENTS} )
160+ if (TARGET LLVMCore)
161+ # If `LLVMCore` target is present, then LLVM is distributed as separate
162+ # libraries and llvm_map_components_to_libnames() should work:
163+ llvm_map_components_to_libnames (llvm_libs ${LPYTHON_LLVM_COMPONENTS} )
164+ else ()
165+ # Workaround for https://github.com/llvm/llvm-project/issues/34593
166+ # If LLVM is distributed as a single library (the LLVMCore target is
167+ # missing), we set `llvm_libs` to "LLVM" which links against the single
168+ # `libLLVM.so` shared library.
169+ set (llvm_libs "LLVM" )
170+ endif ()
161171 unset (LPYTHON_LLVM_COMPONENTS)
162172
163173 add_library (p::llvm INTERFACE IMPORTED )
You can’t perform that action at this time.
0 commit comments