[offload] - Fix issue with standalone debug offload build (#104647) · llvm/llvm-project@be6e2e7 (original) (raw)
File tree
1 file changed
lines changed
- offload/plugins-nextgen/common
1 file changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -11,13 +11,15 @@ add_dependencies(PluginCommon intrinsics_gen) | ||
| 11 | 11 | |
| 12 | 12 | # Only enable JIT for those targets that LLVM can support. |
| 13 | 13 | set(supported_jit_targets AMDGPU NVPTX) |
| 14 | -foreach(target IN LISTS supported_jit_targets) | |
| 15 | - if("${target}" IN_LIST LLVM_TARGETS_TO_BUILD) | |
| 16 | - target_compile_definitions(PluginCommon PRIVATE "LIBOMPTARGET_JIT_${target}") | |
| 17 | - llvm_map_components_to_libnames(llvm_libs ${target}) | |
| 18 | - target_link_libraries(PluginCommon PRIVATE ${llvm_libs}) | |
| 19 | - endif() | |
| 20 | -endforeach() | |
| 14 | +if (NOT LLVM_LINK_LLVM_DYLIB) | |
| 15 | + foreach(target IN LISTS supported_jit_targets) | |
| 16 | + if("${target}" IN_LIST LLVM_TARGETS_TO_BUILD) | |
| 17 | + target_compile_definitions(PluginCommon PRIVATE "LIBOMPTARGET_JIT_${target}") | |
| 18 | + llvm_map_components_to_libnames(llvm_libs ${target}) | |
| 19 | + target_link_libraries(PluginCommon PRIVATE ${llvm_libs}) | |
| 20 | + endif() | |
| 21 | + endforeach() | |
| 22 | +endif() | |
| 21 | 23 | |
| 22 | 24 | # Include the RPC server from the `libc` project if availible. |
| 23 | 25 | if(TARGET llvmlibc_rpc_server AND ${LIBOMPTARGET_GPU_LIBC_SUPPORT}) |