[Qbs] Property from parent overridden instead of concatenated

resurrection at centrum.cz resurrection at centrum.cz
Mon Jul 2 15:42:43 CEST 2018


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!



More information about the Qbs mailing list