Closed Shuenhoy closed 2 years ago
Yes, it is not currently supported, maybe I will consider supporting it on 2.5.2
related issue. https://github.com/xmake-io/xmake/issues/1148
FYI, I just found probably a simpler way to get things work. Current module.mpp
would generate module.mpp.o.pcm
, if we make the naming pattern to module.pcm
, then we can just add a -fprebuilt-module-path=xx
instead of adding module-file for each pcm file.
UPDATE: there is a drawback. The file name must be exactly the same with the module name, or clangd still cannot found. The previous way should be better.
ok, thanks. I will improve c++20 modules on 2.5.2. In addition, I will also support c++20 modules for gcc.
we have supported it, you can try cxxmodules
branch. https://github.com/xmake-io/xmake/pull/2641
However, vscode and other editor/ide should not yet support complie_commands with c++modules.
but vscode and other some ide maybe still not support compile_commands.json with c++modules.
https://github.com/microsoft/vscode-cpptools/issues/6302#issuecomment-1215554637
but vscode and other some ide maybe still not support compile_commands.json with c++modules.
I have made some try with compile_commands.json
manually generated, with clangd
extension and clang
, and it works in general. vscode-cpptools
extension still does not work as your reference, nor does clangd
with gcc
.
However, I have to admit that the whole module thing is still not useable with gcc
and clang
. There are just too many ICEs. The compiler just crashes for the simple codes. Really hope the situation would change next year.
yes, and I have merged it now.
Describe the bug
In current version, the
compile_commands.json
file generated with xmake when using clang11 c++20 modules lost the options"-fmodule-file=xxx.pcm
, which would make clangd cannot find the module I am importing.Expected behavior
The
compile_commands.json
should add the option mentioned.Error output
If applicable, please add verbose the errors output to help us analyze your problem.
Related Environment
Please provide compiling and running environment information:
Additional context
Add any other context about the problem here.