[Qbs] "Multi" Properties

Карелин Павел hkarel at yandex.ru
Mon Dec 18 12:28:22 CET 2017


OK, understood.
Thank you!

18.12.2017 14:15, Christian Kandeler пишет:
> On Mon, 18 Dec 2017 14:04:21 +0300
> Карелин Павел <hkarel at yandex.ru> wrote:
>
>> In my project, I use the following construction:
>>
>>       cpp.defines: {
>>           var def = [];
>>           if (project.simdDebug)
>>               def.push("SIMD_DEBUG");
>>
>>           if (project.useSimd)
>>               def.push("USE_SIMD");
>>
>>           return def;
>>       }
>>
>> It works fine.
>> But I decided to experiment and do the same through "Properties"
>>
>>       Properties {
>>           condition: project.simdDebug
>>           cpp.defines: outer.concat(["SIMD_DEBUG"])
>>       }
>>       Properties {
>>           condition: project.useSimd
>>           cpp.defines: outer.concat(["USE_SIMD"])
>>       }
>>
>> As a result, I get either SIMD_DEBUG or USE_SIMD at the output, but not
>> both at once.
>> Is it possible to get both values immediately using "Properties"?
> No, the Properties items form an implicit "else if" chain, so the conditions should be mutually exclusive if the same property appears in more than one of them. They are not well-suited for additive semantics like in your example.
>
>
> Christian
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20171218/7f385c74/attachment.html>


More information about the Qbs mailing list