Closed glyh closed 2 days ago
please show your compile_commands.json
[
{
"directory": "/home/lyh/PullGround/xmake/tests/projects/c++/modules/hello",
"arguments": ["/sbin/gcc", "-c", "-m64", "-fvisibility=hidden", "-fvisibility-inlines-hidden", "-O3", "-std=c++20", "-fmodules-ts", "-D_GLIBCXX_USE_CXX11_ABI=0", "-DNDEBUG", "-fmodule-mapper=/tmp/.xmake1000/241115/hello/src/hello.mpp", "-x", "c++", "-o", "build/.objs/hello/linux/x86_64/release/src/hello.mpp.o", "src/hello.mpp"],
"file": "src/hello.mpp"
},
{
"directory": "/home/lyh/PullGround/xmake/tests/projects/c++/modules/hello",
"arguments": ["/sbin/gcc", "-c", "-m64", "-fvisibility=hidden", "-fvisibility-inlines-hidden", "-O3", "-std=c++20", "-fmodules-ts", "-D_GLIBCXX_USE_CXX11_ABI=0", "-DNDEBUG", "-fmodule-mapper=/tmp/.xmake1000/241115/hello/src/main.cpp", "-o", "build/.objs/hello/linux/x86_64/release/src/main.cpp.o", "src/main.cpp"],
"file": "src/main.cpp"
}]
it will use gcc by default, if you installed gcc.
you should call xmake f --toolchain=clang
to switch to clang
Xmake Version
xmake v2.9.6+20241030, A cross-platform build utility based on Lua
Operating System Version and Architecture
Linux mechrevo 6.11.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 01 Nov 2024 03:30:41 +0000 x86_64 GNU/Linux
Describe Bug
Expected Behavior
No errors
Project Configuration
I'm using the test case
Additional Information and Error Logs
here's the lsp log for clangd in neovim:
I'm using clangd: