跨平台构建
我有一个应用程序,其中我们使用手工构建系统。这样做的原因是可移植性:该应用程序应该在 Linux/Mac/Windows 上可移植。
有一些特定于端口的文件不会由默认构建系统更新。
我现在所做的是手动更新文件或让脚本执行此操作。但是,我正在考虑切换到跨平台构建系统,例如 cmake
或 scons
。
是否存在与可移植性相关的问题?从长远来看它会付出代价吗?如果是这样,我应该选择什么:“cmake”、“scons”还是其他?
I have an application in which we use a hand-made build system.The reason for this is portability: the application should be portable on Linux/Mac/Windows.
There are some port-specific files that are not updated by the default build system.
What I do now is update the files manually or have a script do this. However, I am thinking of switching to cross-platform build system like cmake
or scons
.
Are there associated problems regarding portability? Will it pay in long run? and if so, what should be my choice: "cmake", "scons" or some other?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
仅当您继续拥有“特定于端口的文件”时。
现成的比手工制作的便宜。时期。你应该非常非常不愿意手工制作任何东西。总是先下载,很少定制,只有在无法将现有工具投入使用时才构建新的工具。
这几乎不重要。现在你可以抛硬币了。
您可以下载并尝试两者。它们非常容易学习。
学习完它们后,你就可以扔硬币了。
重要的是尽快扔掉你手工制作的构建系统。为了做到这一点,你必须完全学习新的。许多人拒绝完全学习新的东西。他们对新的了解了一半,然后继续声称旧的在某种程度上“更好”。
彻底学习新的。彻底删除旧的。别回头。
Only if you continue to have "port-specific files".
Off-the shelf is cheaper than hand-built. Period. You should be very, very reluctant to hand-make anything. Always download first, rarely customize, and build new only when it's impossible to press an existing tool into service.
It barely matters. You can toss a coin now.
You can download both and try both. They're pretty easy to learn.
After learning them, you can then toss a coin.
The important thing is to throw away your hand-made build system as quickly as you can. In order to do that you have to completely learn the new one. Many folks refuse to completely learn the new one. They half-learn the new one and then continue to claim the old one was somehow "better".
Completely learn the new one. Completely delete the old one. Don't look back.
我选择cmake,因为它可以生成XCode项目。这些文档不是那么好,但是有很多用户,所以你可以很容易地使用谷歌找到问题的解决方案。它也有 soma 打包支持,这很方便。
I choose cmake, because it can generate XCode projects. The docs are not that great, but there are plenty users out there, so you can find solutions to problems using google fairly easily. It has soma packaging support too, which can be handy.