简体   繁体   English

如何在 qbs 中安装通用二进制工件?

[英]How to install universal binary artifacts in qbs?

There is my qbs project:有我的qbs项目:

Project {
    StaticLibrary {
        name: "targetLib"
        files: "main.cpp"

        bundle.isBundle: false

        multiplexByQbsProperties: "architectures"
        aggregate: true

        Group {
            fileTagsFilter: "bundle.content"
            qbs.install: true
            qbs.installSourceBase: buildDirectory
        }

        Depends { name: "nawesome" }
        Depends { name: "cpp" }
    }
}

On build I pass profile with set property cpp.architectures: ["arm64", "x86_64"].在构建时,我通过设置属性 cpp.architectures: ["arm64", "x86_64"] 传递配置文件。

As I understand multiplexing works in this way: one builds per every architecture and another one for aggregate to build universal binary.据我了解,多路复用以这种方式工作:每个架构构建一个,另一个用于聚合以构建通用二进制文件。 Aggregate set to its artifact tag "bundle.content" but it doesn't install.聚合设置为其工件标签“bundle.content”,但未安装。

I don't need non-universal binaries installed, so I need some way to eliminate them.我不需要安装非通用二进制文件,所以我需要一些方法来消除它们。 Right now the only way I've found is:现在我发现的唯一方法是:

        Group {
            condition: type.contains("bundle.content")
            fileTagsFilter: "staticlibrary"
            qbs.install: true
            qbs.installSourceBase: buildDirectory
        }

But I don't think this is good one.但我不认为这是一件好事。

From qbs 1.19 on, this should work transparently by just setting "install: true" on the StaticLibrary item (as it already does for non-multiplexed products).从 qbs 1.19 开始,这应该通过在 StaticLibrary 项目上设置“install: true”来透明地工作(就像它已经对非多路复用产品所做的那样)。 See https://codereview.qt-project.org/c/qbs/qbs/+/339928 for how multiplexing is handled there.请参阅https://codereview.qt-project.org/c/qbs/qbs/+/339928了解如何处理多路复用。 But if your workaround does the trick, you could just as well keep using it until then.但是,如果您的解决方法可以解决问题,那么您也可以一直使用它直到那时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM