有没有办法将 Qt 的源代码构建复制到另一个位置?

发布于 2024-09-06 13:27:44 字数 258 浏览 2 评论 0原文

我们正在使用 Qt 的商业许可证构建 Windows 和 Mac 应用程序,我们是从 git 克隆构建的。

我们已经使用 Hudson 和潜在的多个构建代理进行了构建设置,而我想为 Windows 做的至少是构建一次,然后将构建的 Qt 部署到每个代理(而不是必须在每个代理上构建 Qt)。然而,构建的 Qt 似乎不喜欢被移动或复制。

有办法解决这个问题吗?我们的一个想法是是否有一些设置可以构建 Qt,使其类似于它们的二进制发行版,但我看不出有什么方法可以做到这一点。

We're building a Windows and Mac app using a commercial licence of Qt, which we're building from a git clone.

We've got a build setup using Hudson with potentially several build agents, and what I'd like to do for Windows at least is build once then deploy the build Qt to each agent (rather than have to build Qt on each agent). It seems, however, that the built Qt doesn't like to be moved or copied.

Is there a way around this? One thought we had was whether there was some setting that would build Qt so it resembled their binary distribution, but I can't see a way to do this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心欲静而疯不止 2024-09-13 13:27:44

发布的 Qt 二进制文件的工作方式是这样的:

Qt 被构建到一个非常长的构建路径中(例如,在 Windows 上,c:\Qt\______________padding__________for_________packaging________________)。 然后将其打包到安装程序中。安装程序包含一个自定义插件,它在安装时扫描二进制文件并修补 Qt 二进制文件,用用户的安装路径替换长构建路径。请注意,二进制文件的大小无法更改,因此用户的安装路径必须始终比构建路径短...

在 Mac 和 Linux 上也有类似的 rpath 修改。 rpath 要么使用 $ORIGIN 使其相对,要么像上面的路径一样进行二进制修补。

制作二进制包的脚本非常单一,并且这个逻辑不容易提取......

对于您的用例,我建议您始终以可预测的路径构建 Qt。始终在 c:\Qt_test 构建 Qt 并部署到每个代理上的 c:\Qt_test。缺点是 Hudson 可能不太擅长自动清理这个问题,所以你必须自己编写脚本。

The way that the released Qt binaries work is this:

Qt is built into a very long build path (e.g. on windows, c:\Qt\______________padding__________for_________packaging________________). Then it's packed up into an installer. The installer contains a custom plugin which scans through the binaries at install time and patches the Qt binaries, replacing the long build path with the user's install path. Note, the size of the binary can't be changed, so the user's install path must always be shorter than the build path...

On Mac and Linux there is also similar munging of rpaths. Either the rpath uses $ORIGIN to make it relative, or it's binary patched like the above path.

The scripts which make the binary packages are quite monolithic and this logic isn't easily extracted...

For your use case, I would recommend that you simply build Qt in a predictable path all the time. Always build Qt at c:\Qt_test and deploy to c:\Qt_test on each agent. The downside is that Hudson might not be so good at automatically cleaning this up, so you'd have to script that yourself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文