-
-
Notifications
You must be signed in to change notification settings - Fork 788
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
使用 c++ 20 的 modules (clang++ 19),能否单独清除 module 的依赖文件并重新生成? #5856
Comments
Title: When using c++ 20 modules (clang++ 19), can you clear the module's dependency files separately and regenerate them? In what scenario do you need this function?The dependency file caching of modules seems not smart enough, for example Describe possible solutionsIs there a separate command to clean up module dependencies and regenerate them? Now it seems that the only option is to delete the build directory and recompile. Describe your alternativesNo response Other informationNo response |
另外如果修改 c++ module include 的其它头文件,似乎不会触发 module 重新编译 |
In addition, if you modify other header files of c++ module include, it does not seem to trigger module recompilation. |
这边可以的么。没法复现。 ruki-2:hello ruki$ xmake
checking for Xcode directory ... /Applications/Xcode.app
checking for SDK version of Xcode for macosx (x86_64) ... 14.0
[ 0%]: <hello> generating.module.deps src/main.cpp
error: module dependency hello2 required for src/main.cpp not found
warning: some modules have got culled, use verbose (-v) mode to more informations
ruki-2:hello ruki$ perl -pi -e "s/hello2/hello/g" src/main.cpp
ruki-2:hello ruki$ xmake
checking for Xcode directory ... /Applications/Xcode.app
checking for SDK version of Xcode for macosx (x86_64) ... 14.0
[ 0%]: <hello> generating.module.deps src/main.cpp
[ 71%]: compiling.release src/main.cpp
[ 85%]: linking.release hello
[100%]: build ok, spent 2.091s 另外,确保安装了 clang-scan-deps 并已被使用,否则 xmake 只能 fallback 内建的模块依赖分析,精准度肯定没 clang-scan-deps 自带的准。 |
你在什么场景下需要该功能?
modules 的依赖文件缓存似乎不够聪明,比如
import wrong_module; // wrong_module 不存在
编译生成 module 依赖后,编译到该文件时报错
把它改为正确的如 import right_module;
仍然会报错没有 wrong_module
描述可能的解决方案
有没有单独的命令可以清理module依赖重新生成?现在似乎只能删build目录重新编译
描述你认为的候选方案
No response
其他信息
No response
The text was updated successfully, but these errors were encountered: