[clang-tools-extra] b801b60 - [clangd] Make sure ninja can clean "ClangdXPC.framework" (#75669)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 24 09:12:04 PST 2024
Author: Jan Svoboda
Date: 2024-01-24T09:12:00-08:00
New Revision: b801b607e38ca9113394a918f475e5a521b7ec13
URL: https://github.com/llvm/llvm-project/commit/b801b607e38ca9113394a918f475e5a521b7ec13
DIFF: https://github.com/llvm/llvm-project/commit/b801b607e38ca9113394a918f475e5a521b7ec13.diff
LOG: [clangd] Make sure ninja can clean "ClangdXPC.framework" (#75669)
After building the ClangdXPC target, `ninja clean` fails with the
following error:
```
ninja: error: remove(lib/ClangdXPC.framework): Directory not empty
ninja: error: remove(<build>/lib/ClangdXPC.framework): Directory not empty
```
I did not find better way to make this work. I guess we could list all
generated files (and directories) in `OUTPUT` of the custom command, but
that seems fairly tedious/fragile.
Added:
Modified:
clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake b/clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
index 46738a204ace14..d5ba44962dd528 100644
--- a/clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
+++ b/clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
@@ -71,6 +71,12 @@ macro(create_clangd_xpc_framework target name)
${CLANGD_FRAMEWORK_LOCATION}
)
+ set_property(
+ TARGET ClangdXPC
+ APPEND
+ PROPERTY ADDITIONAL_CLEAN_FILES ${CLANGD_FRAMEWORK_LOCATION}
+ )
+
# clangd is already signed as a standalone executable, so it must be forced.
llvm_codesign(ClangdXPC BUNDLE_PATH "${CLANGD_FRAMEWORK_OUT_LOCATION}/XPCServices/${CLANGD_XPC_SERVICE_NAME}.xpc/" FORCE)
# ClangdXPC library is already signed as a standalone library, so it must be forced.
More information about the cfe-commits
mailing list