[llvm-branch-commits] [mlir] 11f41cd - [mlir][python] Install generated dialect sources.

Stella Laurenzo via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 29 20:20:00 PST 2020


Author: Stella Laurenzo
Date: 2020-12-29T20:15:07-08:00
New Revision: 11f41cd4451554d6ad6065dc7cd6c9349159c567

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

LOG: [mlir][python] Install generated dialect sources.

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

Added: 
    

Modified: 
    mlir/lib/Bindings/Python/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Bindings/Python/CMakeLists.txt b/mlir/lib/Bindings/Python/CMakeLists.txt
index 0f51ce54ed09..83e978a6e046 100644
--- a/mlir/lib/Bindings/Python/CMakeLists.txt
+++ b/mlir/lib/Bindings/Python/CMakeLists.txt
@@ -71,4 +71,23 @@ if (NOT LLVM_ENABLE_IDE)
     COMPONENT MLIRBindingsPythonSources)
 endif()
 
+# Dialect sources are generated. Install separately.
+# Note that __pycache__ directories may have been left by tests and other
+# executions. And __init__.py is handled as a regular source file.
+install(
+  DIRECTORY ${PROJECT_BINARY_DIR}/python/mlir/dialects
+  DESTINATION python/mlir
+  COMPONENT MLIRBindingsPythonDialects
+  FILES_MATCHING PATTERN "*.py"
+  PATTERN "__pycache__" EXCLUDE
+  PATTERN "__init__.py" EXCLUDE
+)
+
+if (NOT LLVM_ENABLE_IDE)
+  add_llvm_install_targets(
+    install-MLIRBindingsPythonDialects
+    DEPENDS MLIRBindingsPythonSources
+    COMPONENT MLIRBindingsPythonDialects)
+endif()
+
 add_subdirectory(Transforms)


        


More information about the llvm-branch-commits mailing list