diff --git a/clang/cmake/modules/CMakeLists.txt b/clang/cmake/modules/CMakeLists.txt --- a/clang/cmake/modules/CMakeLists.txt +++ b/clang/cmake/modules/CMakeLists.txt @@ -32,7 +32,8 @@ # For compatibility with projects that include(ClangConfig) # via CMAKE_MODULE_PATH, place API modules next to it. -# Copy without source permissions because the source could be read-only +# Copy without source permissions because the source could be read-only, +# but we need to write into the copied folder. file(COPY . DESTINATION ${clang_cmake_builddir} NO_SOURCE_PERMISSIONS diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt --- a/llvm/cmake/modules/CMakeLists.txt +++ b/llvm/cmake/modules/CMakeLists.txt @@ -99,9 +99,12 @@ # For compatibility with projects that include(LLVMConfig) # via CMAKE_MODULE_PATH, place API modules next to it. +# Copy without source permissions because the source could be read-only, +# but we need to write into the copied folder. # This should be removed in the future. file(COPY . DESTINATION ${llvm_cmake_builddir} + NO_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.cmake PATTERN CMakeFiles EXCLUDE ) diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt --- a/mlir/cmake/modules/CMakeLists.txt +++ b/mlir/cmake/modules/CMakeLists.txt @@ -42,9 +42,12 @@ # For compatibility with projects that include(MLIRConfig) # via CMAKE_MODULE_PATH, place API modules next to it. +# Copy without source permissions because the source could be read-only, +# but we need to write into the copied folder. # This should be removed in the future. file(COPY . DESTINATION ${mlir_cmake_builddir} + NO_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.cmake PATTERN CMakeFiles EXCLUDE )