diff --git a/mlir/lib/Bindings/Python/CMakeLists.txt b/mlir/lib/Bindings/Python/CMakeLists.txt --- a/mlir/lib/Bindings/Python/CMakeLists.txt +++ b/mlir/lib/Bindings/Python/CMakeLists.txt @@ -79,7 +79,8 @@ # Note that we copy from the source tree just like for headers because # it will not be polluted with py_cache runtime artifacts (from testing and -# such). +# such). Note that Windows has trouble installing symlinks, which makes it +# necessary to install these from the source tree. install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/mlir DESTINATION python @@ -94,14 +95,13 @@ 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 generated dialect sources, all of which have the same file name +# pattern (and must not match any source file patterns). install( DIRECTORY ${PROJECT_BINARY_DIR}/python/mlir/dialects DESTINATION python/mlir COMPONENT MLIRBindingsPythonDialects - FILES_MATCHING PATTERN "*.py" + FILES_MATCHING PATTERN "_*_gen.py" PATTERN "__pycache__" EXCLUDE PATTERN "__init__.py" EXCLUDE )