Closed poscat0x04 closed 1 year ago
As you can see, the first argument, "/usr/bin/xcrun -sdk macosx clang" is invalid as it does not point to an executable and should be broken up into four arguments instead.
no, it's valid and it works for me. It has been around for a long time and no other user has ever reported an error because of it.
According to the spec of compilation database, the first argument should be the executable name. This is also how CLion interprets it, which leads to errors when using CLion.
which leads to errors when using CLion.
which errors? it works for vscode on my machine and I cannot get any errors in CLion.
CLion complains about not being able to find "/usr/bin/xcrun -sdk macosx clang" in path (which I think is 100% justified)
I can't reproduce the problem at the moment, so you can verify that it works by manually changing it to something like the following.
"arguments": ["/usr/bin/xcrun", "-sdk", "macosx", "clang", "-c", "-Qunused-arguments", "-target", "arm64-apple-macos12.6", ...
If this works, I will try to improve it.
Yes, breaking up the first argument does work.
try it again, xmake update -s dev
but clangd does not support ["/usr/bin/xcrun", "-sdk", "macosx", "clang"
I improved it again, it will convert to "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
xmake update -s dev
Xmake Version
v2.7.3+202211090100
Operating System Version and Architecture
macOS Monterey
Describe Bug
When being used to compile 墨干 on macOS, xmake generates invalid compilation database files:
(full file)
As you can see, the first argument,
"/usr/bin/xcrun -sdk macosx clang"
is invalid as it does not point to an executable and should be broken up into four arguments instead.Expected Behavior
The generated compilation database file should be valid
Project Configuration
No response
Additional Information and Error Logs
To reproduce, just clone mogan and run
xmake project -k compile_commands