Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clangd] Make sure ninja can clean "ClangdXPC.framework" #75669

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

jansvoboda11
Copy link
Contributor

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.

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.
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 15, 2023

@llvm/pr-subscribers-clangd

Author: Jan Svoboda (jansvoboda11)

Changes

After building the ClangdXPC target, ninja clean fails with the following error:

ninja: error: remove(lib/ClangdXPC.framework): Directory not empty
ninja: error: remove(&lt;build&gt;/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.


Full diff: https://github.com/llvm/llvm-project/pull/75669.diff

1 Files Affected:

  • (modified) clang-tools-extra/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake (+6)
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.

Copy link
Contributor

@jkorous-apple jkorous-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jansvoboda11 jansvoboda11 merged commit b801b60 into llvm:main Jan 24, 2024
5 checks passed
@jansvoboda11 jansvoboda11 deleted the clangd-xpc-rm-dir branch January 24, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants