[QBS] Increasing verbosity of targetOS-based on conditions in user code

Jake Thomas Petroules jake.petroules at petroules.com
Thu Jun 13 05:08:34 CEST 2013


Based on the changes we've discussed recently regarding turning targetOS, hostOS and toolchain into lists, user code (such as in Group/Properties conditions) might get a little verbose.

Group {
    condition: qbs.targetOS.indexOf("windows") !== -1 || qbs.targetOS.indexOf("darwin") !== -1
    files: [ "MicrosoftAppleCode.c" ]
}

Therefore, I'd like to propose a 'filter' property which could be used like so:

Group {
    filter: { "qbs.targetOS": ["windows", "darwin"] }
    files: [ "MicrosoftAppleCode.c" ]
}

This would be applied if any of the given items in the specified set exist in the qbs.targetOS list. The same could be done for the cpp.toolchain property for example. Multiple key-value pairs could be specified as well. The effective condition should be condition && (matches filter) to allow both properties to be used in combination. If any of the keys specified in the filter do not point to Array types, an exception should be thrown.

-- 
Jake Petroules
Chief Technology Officer
Petroules Corporation ยท www.petroules.com
Email: jake.petroules at petroules.com

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


More information about the Qbs mailing list