diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-10-19 00:58:22 +0200 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-11-22 16:48:33 +0000 |
commit | e9b79f0d5165dc71dac10ed76b5fa06508672605 (patch) | |
tree | 4a06ccedb5829e07da4c523ee0e268d467ea3f0c /doc | |
parent | 9193447cb4f7242816bffde0b6101636632ebd17 (diff) | |
download | qbs-e9b79f0d5165dc71dac10ed76b5fa06508672605.tar.gz |
Add qbs.targetPlatform and qbs.hostPlatform properties
This allows users to set the target platform from within project files,
since it is a scalar value. The values of qbs.targetOS and qbs.hostOS
are now derived from these new scalar properties.
[ChangeLog] Added qbs.targetPlatform and qbs.hostPlatform properties
which are scalar versions of qbs.targetOS and qbs.hostOS.
qbs.targetPlatform is a "write-only" property that can be used to
set the OS/platform that is being targeted, while qbs.targetOS
and qbs.hostOS should continue to be used to *read* the OS/platform
that is being targeted. qbs.targetOS is also now read-only.
Task-number: QBS-1070
Change-Id: Id3fd206a5b2ebee2d626f3e5ab02ecd1dc90d90a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/reference/items/language/profile.qdoc | 2 | ||||
-rw-r--r-- | doc/reference/modules/qbs-module.qdoc | 60 |
2 files changed, 36 insertions, 26 deletions
diff --git a/doc/reference/items/language/profile.qdoc b/doc/reference/items/language/profile.qdoc index e654fa34e..072feb6b2 100644 --- a/doc/reference/items/language/profile.qdoc +++ b/doc/reference/items/language/profile.qdoc @@ -49,7 +49,7 @@ Profile { name: "my-special-profile" qbs.toolchain: ["gcc"] - qbs.targetOS: ["linux", "unix"] + qbs.targetPlatform: "linux" qbs.architecture: "armv7a" cpp.toolchainInstallPath: "/opt/special-gcc/bin" cpp.toolchainPrefix: "arm-linux-gnueabi-" diff --git a/doc/reference/modules/qbs-module.qdoc b/doc/reference/modules/qbs-module.qdoc index 50f9c6d58..7f73c5f1f 100644 --- a/doc/reference/modules/qbs-module.qdoc +++ b/doc/reference/modules/qbs-module.qdoc @@ -79,48 +79,42 @@ \li Specifies the general type of optimization that should be performed by all toolchains. Allowed values: \c{"none"}, \c{"fast"}, \c{"small"} \row - \li targetOS + \li targetPlatform \li \c{stringList} - \li 1.0 + \li 1.11 \li \c{undefined} - \li Specifies the OS you want to build the project for. This is typically set in a profile. - Possible values include one or more of the following: + \li Specifies the OS you want to build the project for. This is typically set in a profile + or for a particular product where the target OS is always known (such as an Apple Watch + app written in native code). You should generally treat this property as \e{write-only} + and avoid using it to test for the current target OS. Instead, use the + \c targetOS property for conditionals. For example, instead of: + \c{(qbs.targetPlatform === "macos" || qbs.targetPlatform === "ios" || + qbs.targetPlatform === "tvos" || qbs.targetPlatform === "watchos")}, + use \c{qbs.targetOS.contains("darwin")}. However, there are some cases when using + targetPlatform would be acceptable, such as when the resulting condition would be + simpler while still being correct: \c{(qbs.targetPlatform === "linux")} versus + \c{(qbs.targetOS.contains("linux") && !qbs.targetOS.contains("android"))}. + Possible values include one the following: \c{"aix"}, \c{"android"}, - \c{"bsd"}, - \c{"bsd4"}, - \c{"bsdi"}, - \c{"cygwin"}, - \c{"darwin"}, - \c{"dgux"}, - \c{"dynix"}, \c{"freebsd"}, + \c{"haiku"}, \c{"hpux"}, \c{"hurd"}, \c{"integrity"}, \c{"ios"}, \c{"ios-simulator"}, - \c{"irix"}, \c{"linux"}, - \c{"lynx"}, \c{"macos"}, - \c{"msdos"}, - \c{"nacl"}, \c{"netbsd"}, \c{"openbsd"}, - \c{"os2"}, - \c{"os2emx"}, - \c{"osf"}, \c{"qnx"}, - \c{"qnx6"}, - \c{"reliant"}, - \c{"sco"}, \c{"solaris"}, - \c{"symbian"}, - \c{"ultrix"}, - \c{"unix"}, - \c{"unixware"}, + \c{"tvos"}, + \c{"tvos-simulator"}, \c{"vxworks"}, + \c{"watchos"}, + \c{"watchos-simulator"}, \c{"windows"} \row \li architecture @@ -236,6 +230,22 @@ \li \c{hostOSVersionParts[2]} \li The host operating system patch level. \row + \li hostPlatform + \li \c{string} + \li 1.11 + \li determined automatically + \li Do not use this property. + \row + \li targetOS + \li \c{stringList} + \li 1.0 + \li \c{undefined} + \li Specifies the OS you want to build the project for. + You should use this property to test for a particular OS or OS family in conditionals. + Do not use \c targetPlatform for this purpose. Possible values include one or more of: + \c{"bsd"}, \c{"darwin"}, and \c{"unix"}, in + addition to the possible values of \c targetPlatform. + \row \li version \li \c{string} (read only) \li 1.4.1 |