[Qbs] Property from parent overridden instead of concatenated
resurrection at centrum.cz
resurrection at centrum.cz
Mon Jul 2 15:50:24 CEST 2018
And I will answer myself after re-examining the docs. One has to use `base.concat()` when appending inherited properties. I think I even understand why that is not default - it would not be possible to override the property entirely otherwise.
______________________________________________________________
> Od: <resurrection at centrum.cz>
> Komu: <qbs at qt-project.org>
> Datum: 02.07.2018 15:42
> Předmět: [Qbs] Property from parent overridden instead of concat
>
I remember seeing something about this but I wanted to know if this is a WAD or bug. Consider:
//imports/MyProduct.qbs
Product {
Depends { name: "cpp" }
cpp.defines: ["MY_DEF"]
}
//SomeProject.qbs
MyProduct {
cpp.defines: ["ANOTHER_DEF"]
}
What will be the value of `cpp.defines`? To me quite unexpectedly only "ANOTHER_DEF". In order to have both values I would need to do this:
MyProduct {
Properties {
condition: true
cpp.defines: [String(outer), "ANOTHER_DEF"]
}
}
That is pretty weird to me. First of all the fact that unlike elsewhere (e.g. from a Module) inherited properties are overriden. But even more the fact that "outer" is neither list/array nor string. It needs to be explicitely converted to String to satisfy some kind of condition that forces all cpp.defines to be of type String even if they are actually convertible to it.
Is there a better way doing this? Or is it a bug/inconsistency that will be addressed? I am using Qbs 1.12.0.
Thank!
_______________________________________________
Qbs mailing list
Qbs at qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs <http://lists.qt-project.org/mailman/listinfo/qbs>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20180702/7f92f659/attachment.html>
More information about the Qbs
mailing list