[Mlir-commits] [mlir] f46ce03 - [MLIR] Add an install target for mlir-libraries

Nathan Lanza llvmlistbot at llvm.org
Tue Jun 7 19:57:22 PDT 2022


Author: Nathan Lanza
Date: 2022-06-07T22:57:07-04:00
New Revision: f46ce0373430c6f455442a53e39cdad2e7c034f2

URL: https://github.com/llvm/llvm-project/commit/f46ce0373430c6f455442a53e39cdad2e7c034f2
DIFF: https://github.com/llvm/llvm-project/commit/f46ce0373430c6f455442a53e39cdad2e7c034f2.diff

LOG: [MLIR] Add an install target for mlir-libraries

This is required for the distribution system for installing the
mlir-libraries component. This is copied from clang's equivalent
feature.

Differential Revision: https://reviews.llvm.org/D126837

Added: 
    

Modified: 
    mlir/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index ab56b19d57aa7..35d68bdfc0abe 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -217,6 +217,28 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   endif()
 endif()
 
+# Custom target to install all mlir libraries
+add_custom_target(mlir-libraries)
+set_target_properties(mlir-libraries PROPERTIES FOLDER "Misc")
+
+if (NOT LLVM_ENABLE_IDE)
+  add_llvm_install_targets(install-mlir-libraries
+                           DEPENDS mlir-libraries
+                           COMPONENT mlir-libraries)
+endif()
+
+get_property(MLIR_LIBS GLOBAL PROPERTY MLIR_ALL_LIBS)
+if(MLIR_LIBS)
+  list(REMOVE_DUPLICATES MLIR_LIBS)
+  foreach(lib ${MLIR_LIBS})
+    add_dependencies(mlir-libraries ${lib})
+    if(NOT LLVM_ENABLE_IDE)
+      add_dependencies(install-mlir-libraries install-${lib})
+      add_dependencies(install-mlir-libraries-stripped install-${lib}-stripped)
+    endif()
+  endforeach()
+endif()
+
 add_subdirectory(cmake/modules)
 
 if (MLIR_ENABLE_PYTHON_BENCHMARKS)


        


More information about the Mlir-commits mailing list