Skip to content

关于C++20 module编译错误的问题 #4666

Answered by waruqi
Extra-Creativity asked this question in Q&A
Discussion options

You must be logged in to vote

这个目前没有更好的办法,你用的编译器不支持原生的模块依赖扫描,走的是 xmake 内置的扫描实现,是有局限性的,你只能改成 .mpp 。。

if not module_depname and not has_module_extension(sourcefile) then

除非你用最新的 gcc,clang 或者切到 msvc ,让 xmake 优先使用编译器原生提供的 模块依赖扫描接口,才能提供更加精准的依赖分析。。

你可以升级你的编译器,确保 clang-scan-deps 可用,或者用最新支持 modules 的 gcc 版本,或者用 msvc preview

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@Extra-Creativity
Comment options

@waruqi
Comment options

Comment options

You must be logged in to vote
2 replies
@Extra-Creativity
Comment options

@waruqi
Comment options

Answer selected by Extra-Creativity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants