-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
swift多文件编译未合并在同一个module中造成编译失败 #3916
Comments
Title: swift multi-file compilation is not merged in the same module, resulting in compilation failure Xmake version2.7.9+20230515 OS version and architecturemacOS 13.4.1 (22F82) Describe the problemIn the syntax of swift, it is allowed to compile multiple files as a module by inputting them into example:
However, in the processing of Expected resultsCompiled normally Project configurationNo response Additional information and error logsNo response |
合并成一条命令编译,类似 rust 这种,尽管可以,改动太大,并且有很多局限性,比如无法细粒度设置单独每个 swift 文件的 flags 。。也没法做并行编译优化。。所以能不搞一起 尽量不搞一起。。 可以先先研究下拆分 obj 编译时候的 module 支持方案,我记得应该是可以的,比如用 modulemap 什么的,但是具体怎么弄,要花时间分析,这块先放着吧,最近也没太多时间。。或者你可以先自己研究下 如何单独编译某个 swift 时候,支持引入其他 module 符号 |
Combined into one command to compile, similar to rust, although it is possible, the changes are too large, and there are many limitations, such as the inability to set the flags of each individual swift file in a fine-grained manner. . There is no way to do parallel compilation optimization. . So try not to get together if you can. . You can first study the module support scheme when compiling the split obj. I remember that it should be possible, such as using modulemap or something, but how to do it will take time to analyze. Let’s put this one first, and there are not too many recently. time. . Or you can study on your own how to import other module symbols when compiling a swift separately |
你先提供个可复现的完整 example project 过来 |
You first provide a complete example project that can be reproduced |
|
再试试, |
Try again, |
我手头上的工程没问题了👌 |
I have no problem with the project at hand👌 |
Xmake 版本
2.7.9+20230515
操作系统版本和架构
macOS 13.4.1 (22F82)
描述问题
在swift的语法中, 允许通过一次性将多个文件输入
swiftc
中, 作为一个module进行编译:例:
swiftc -o Test A.swift B.swift
// success然而在
xmake
的处理中, 每个文件被分开进行编译, 这就使得例中的B.swift
因找不到符号导致编译失败.期待的结果
正常通过编译
工程配置
No response
附加信息和错误日志
No response
The text was updated successfully, but these errors were encountered: