File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,17 @@ if (WITH_LLVM)
157
157
add_definitions ("-DHAVE_TARGET_X86=1" )
158
158
endif ()
159
159
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 ()
161
171
unset (LPYTHON_LLVM_COMPONENTS )
162
172
163
173
add_library (p::llvm INTERFACE IMPORTED )
You can’t perform that action at this time.
0 commit comments