File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -70,17 +70,20 @@ if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
70
70
if (MLIR_ENABLE_NVPTXCOMPILER )
71
71
# Find the `nvptxcompiler` library.
72
72
# TODO: Bump the MLIR CMake version to 3.25 and use `CUDA::nvptxcompiler_static`.
73
- find_library (MLIR_NVPTXCOMPILER_LIB nvptxcompiler_static
73
+ find_library (MLIR_NVPTXCOMPILER_LIB_PATH nvptxcompiler_static
74
74
PATHS ${CUDAToolkit_LIBRARY_DIR} NO_DEFAULT_PATH )
75
75
76
76
# Fail if `nvptxcompiler_static` couldn't be found.
77
- if (MLIR_NVPTXCOMPILER_LIB STREQUAL "MLIR_NVPTXCOMPILER_LIB -NOTFOUND" )
77
+ if (MLIR_NVPTXCOMPILER_LIB_PATH STREQUAL "MLIR_NVPTXCOMPILER_LIB_PATH -NOTFOUND" )
78
78
message (FATAL_ERROR
79
79
"Requested using the `nvptxcompiler` library backend but it couldn't be found." )
80
80
endif ()
81
81
82
+ add_library (MLIR_NVPTXCOMPILER_LIB STATIC IMPORTED GLOBAL )
83
+ # Downstream project can modify this path and use it in CMake
84
+ set_property (TARGET MLIR_NVPTXCOMPILER_LIB PROPERTY IMPORTED_LOCATION ${MLIR_NVPTXCOMPILER_LIB_PATH} )
82
85
# Link against `nvptxcompiler_static`. TODO: use `CUDA::nvptxcompiler_static`.
83
- target_link_libraries (MLIRNVVMTarget PRIVATE ${ MLIR_NVPTXCOMPILER_LIB} )
86
+ target_link_libraries (MLIRNVVMTarget PRIVATE MLIR_NVPTXCOMPILER_LIB )
84
87
target_include_directories (obj.MLIRNVVMTarget PUBLIC ${CUDAToolkit_INCLUDE_DIRS} )
85
88
endif ()
86
89
else ()
You can’t perform that action at this time.
0 commit comments