关于C++20 module编译错误的问题 #4666
Answered
by
waruqi
Extra-Creativity
asked this question in
Q&A
关于C++20 module编译错误的问题
#4666
-
把xmake的C++ module的internal partition测试里的hello_internal.mpp改名为hello_internal.cpp(xmake.lua也相应改下)就会分析出自己对自己的循环依赖,感觉是bug吧?用的是g++,11和13都有这问题。 |
Beta Was this translation helpful? Give feedback.
Answered by
waruqi
Feb 15, 2024
Replies: 2 comments 4 replies
-
试下 #4321 这个 patch 呢,最近再重构 |
Beta Was this translation helpful? Give feedback.
2 replies
-
再试试 modules 这个分支呢,最近对模块重构 有改进过对循环依赖的检测支持。。 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这个目前没有更好的办法,你用的编译器不支持原生的模块依赖扫描,走的是 xmake 内置的扫描实现,是有局限性的,你只能改成 .mpp 。。
xmake/xmake/rules/c++/modules/modules_support/common.lua
Line 548 in 963f544
除非你用最新的 gcc,clang 或者切到 msvc ,让 xmake 优先使用编译器原生提供的 模块依赖扫描接口,才能提供更加精准的依赖分析。。
你可以升级你的编译器,确保 clang-scan-deps 可用,或者用最新支持 modules 的 gcc 版本,或者用 msvc preview