From f80c6d8dec1866424d66a0b1ab67c082e2d08375 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Tue, 10 Mar 2020 04:09:33 +0000 Subject: [PATCH] Fix MLIR build when NVPTX backend is not configured in The GPUToCUDA conversion needs to conditionally link it in. --- mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt b/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt index afc3906..c8f0ded 100644 --- a/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt @@ -8,14 +8,17 @@ set(SOURCES if (MLIR_CUDA_CONVERSIONS_ENABLED) list(APPEND SOURCES "ConvertKernelFuncToCubin.cpp") + set(NVPTX_LIBS + LLVMNVPTXCodeGen + LLVMNVPTXDesc + LLVMNVPTXInfo + ) endif() add_mlir_conversion_library(MLIRGPUtoCUDATransforms ${SOURCES}) target_link_libraries(MLIRGPUtoCUDATransforms PUBLIC - LLVMNVPTXCodeGen - LLVMNVPTXDesc - LLVMNVPTXInfo + ${NVPTX_LIBS} LLVMCore LLVMMC LLVMSupport -- 2.7.4