Skip to content

Commit f80c6d8

Browse files
author
Mehdi Amini
committed
Fix MLIR build when NVPTX backend is not configured in
The GPUToCUDA conversion needs to conditionally link it in.
1 parent 627bb31 commit f80c6d8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ set(SOURCES
88

99
if (MLIR_CUDA_CONVERSIONS_ENABLED)
1010
list(APPEND SOURCES "ConvertKernelFuncToCubin.cpp")
11+
set(NVPTX_LIBS
12+
LLVMNVPTXCodeGen
13+
LLVMNVPTXDesc
14+
LLVMNVPTXInfo
15+
)
1116
endif()
1217

1318
add_mlir_conversion_library(MLIRGPUtoCUDATransforms ${SOURCES})
1419
target_link_libraries(MLIRGPUtoCUDATransforms
1520
PUBLIC
16-
LLVMNVPTXCodeGen
17-
LLVMNVPTXDesc
18-
LLVMNVPTXInfo
21+
${NVPTX_LIBS}
1922
LLVMCore
2023
LLVMMC
2124
LLVMSupport

0 commit comments

Comments
 (0)