On Tue, 4 Sep 2018 17:27:16 +0200
Алексей Скородумов <[email protected]> wrote:
> > (I assume here that you want to build ony a selected subset of products
> > twice. Otherwise, you should of course rather build the project for two
> > different configurations:
> > $ qbs build config:configBar cpp.defines:BAR config:configFoo
> > cpp.defines:FOO)
>
> 1. Why is it better?
Simply because this approach matches what should be achieved, namely building
the entire project for two different configurations. But again, if you really
want to build only selected products twice, then your approach is perfectly
fine.
> 2. I have tried to do this inside project file and I got the following:
>
> CppApplication {
> name: "foo-bar"
> multiplexByQbsProperties: ["buildVariants"]
> qbs.buildVariants: ["FOO", "BAR"]
That's likely to lead to unexpected results, as qbs only expects the values
"debug" and "release" here.
> property var cppDefines: {
> var defines = [];
> if (qbs.buildVariant === "FOO")
> defines.push("FOO");
> if (qbs.buildVariant === "BAR")
> defines.push("BAR")
> return defines;
> }
>
> cpp.defines: cppDefines
> files: [
> "main.cpp"
> ]
> }
>
> It works, but while building from QtCreator I always get a release build. What
> is wrong here?
What did you expect to happen?
Christian
_______________________________________________
Qbs mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qbs