[Mlir-commits] [mlir] 1228109 - [mlir] Fix INSTALL_INTERFACE path for MLIRSparseTensorEnums
Michał Górny
llvmlistbot at llvm.org
Mon Oct 24 11:27:51 PDT 2022
Author: Michał Górny
Date: 2022-10-24T20:27:40+02:00
New Revision: 12281099dc9436920b9370ce1db714845ea662b9
URL: https://github.com/llvm/llvm-project/commit/12281099dc9436920b9370ce1db714845ea662b9
DIFF: https://github.com/llvm/llvm-project/commit/12281099dc9436920b9370ce1db714845ea662b9.diff
LOG: [mlir] Fix INSTALL_INTERFACE path for MLIRSparseTensorEnums
Fix INSTALL_INTERFACE path for exported MLIRSparseTensorEnums target
to include the include directory. Otherwise, CMake attempts to find it
relatively to CMAKE_INSTALL_PREFIX rather than the include directory,
resulting in flang failing to configure with the following error:
CMake Error at /usr/lib/llvm/16/lib64/cmake/llvm/AddLLVM.cmake:581 (add_library):
Cannot find source file:
/usr/lib/llvm/16/mlir/Dialect/SparseTensor/IR/Enums.h
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
Call Stack (most recent call first):
cmake/modules/AddFlang.cmake:64 (llvm_add_library)
lib/Lower/CMakeLists.txt:3 (add_flang_library)
Differential Revision: https://reviews.llvm.org/D136590
Added:
Modified:
mlir/lib/Dialect/SparseTensor/IR/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/SparseTensor/IR/CMakeLists.txt b/mlir/lib/Dialect/SparseTensor/IR/CMakeLists.txt
index fb1bc6e1561c9..32538b88f121c 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/SparseTensor/IR/CMakeLists.txt
@@ -30,7 +30,7 @@ add_library(MLIRSparseTensorEnums INTERFACE)
foreach(hdr ${MLIRSparseTensorEnums_hdrs})
target_sources(MLIRSparseTensorEnums INTERFACE
$<BUILD_INTERFACE:${MLIR_MAIN_INCLUDE_DIR}/${hdr}>
- $<INSTALL_INTERFACE:${hdr}>)
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${hdr}>)
endforeach()
# The `add_mlir_library_install` is required for other libraries to
# depend on this one, but the conditional itself and the phony target
More information about the Mlir-commits
mailing list