[mlir][python] Install generated dialect sources.

Differential Revision: https://reviews.llvm.org/D93928
This commit is contained in:
Stella Laurenzo 2020-12-29 18:06:24 -08:00
parent 329b887286
commit 11f41cd445
1 changed files with 19 additions and 0 deletions

View File

@ -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)