diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/qbs.qdoc | 214 | ||||
-rw-r--r-- | doc/reference/cli/cli-options.qdocinc | 1 | ||||
-rw-r--r-- | doc/reference/items/probe/sdcc-probe.qdoc | 93 | ||||
-rw-r--r-- | doc/reference/modules/android-ndk-module.qdoc | 15 | ||||
-rw-r--r-- | doc/reference/modules/android-sdk-module.qdoc | 40 | ||||
-rw-r--r-- | doc/reference/modules/protobufcpp-module.qdoc | 19 | ||||
-rw-r--r-- | doc/reference/modules/qbs-module.qdoc | 139 | ||||
-rw-r--r-- | doc/reference/modules/qt-android_support-module.qdoc | 9 | ||||
-rw-r--r-- | doc/targets/qbs-target-platforms.qdoc | 3 |
9 files changed, 483 insertions, 50 deletions
diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc index 1eb1d2bec..d2c703491 100644 --- a/doc/qbs.qdoc +++ b/doc/qbs.qdoc @@ -450,7 +450,7 @@ To build \QBS from the source, you need: \list - \li Qt 5.9, or later + \li Qt 5.11, or later \li Windows: MinGW with GCC 4.9 or Microsoft Visual Studio 2015, or later \li Linux: GCC 4.9, or later, or Clang 3.9.0, or later @@ -470,7 +470,7 @@ Regenerating the man page requires the \c help2man tool. - \section1 Building + \section1 Building \QBS with QMake To build \QBS, enter the following command: @@ -488,7 +488,7 @@ make install INSTALL_ROOT=$INSTALL_DIRECTORY \endcode - \section1 Configure Options + \section2 QMake Configure Options \QBS recognizes the following qmake CONFIG options to customize the build: @@ -510,6 +510,185 @@ before running qmake to specify a custom location for \QBS to look for its system-level settings. + \section1 Building \QBS with \QBS + + It is also possible to build \QBS with the previously installed \QBS version. + To build \QBS, enter the following command in the source directory: + \code + qbs + \endcode + This will use the \c defaultProfile or pick up the Qt version and the toolchain from the \c PATH + if the \c defaultProfile is not set. See \l {Configuring Profiles and Preferences} for details + about profiles. + + To run automatic tests, the \c autotest-runner product should be built: + \code + qbs build -p autotest-runner + \endcode + \QBS will use an empty profile when running tests which means it will try to autodetect + toolchains, Qt versions and other things based on the system environment. + It is possible to specify which profile should be used during the test-run by passing the + \c QBS_AUTOTEST_PROFILE environment variable. + This variable should be set prior to building \QBS itself; otherwise the \c resolve command + should be used to update the environment stored in the buildgraph: + \code + export QBS_AUTOTEST_PROFILE=qt + qbs resolve + qbs build -p autotest-runner + \endcode + + It is also possible to set up a separate profile for a particular testsuite. + A profile for the \c tst_blackbox_android suite can be set up as follows: + \code + qbs setup-android pie + export QBS_AUTOTEST_PROFILE_BLACKBOX_ANDROID=pie + \endcode + + It might be useful to set up the directory with the \QBS settings to isolate the test + environment: + \code + export QBS_AUTOTEST_SETTINGS_DIR=~/path/to/qbs/settings + \endcode + + \section2 \QBS Build Options + + The \c qbsbuildconfig module can be used to customize the build. + Properties of that module can be passed using command line as follows: + \code + qbs build modules.qbsbuildconfig.enableAddressSanitizer:true + \endcode + + \QBS recognizes the following properties: + \table + \header + \li Property + \li Default value + \li Notes + \row + \li enableAddressSanitizer + \li \c false + \li Whether to use address sanitizer or not. Enabling this option will add the + -fsanitize=address flag. + \row + \li enableUnitTests + \li \c false + \li Enable additional autotests. Enabling this option will export some symbols that would + otherwise be private. + \row + \li enableProjectFileUpdates + \li \c false + \li Enable API for updating project files. This is required for an IDE and implies a + dependency to the Qt GUI module that would not be needed for the \QBS command-line tool. + \row + \li enableRPath + \li \c true + \li Use this property to disable the use of rpath. This can be used when packaging \QBS + for distributions which do not permit the use of rpath, such as Fedora. + \row + \li installApiHeaders + \li \c true + \li Holds whether to install the header files for the \QBS libraries or not. This option + is required to build against the \QBS libraries. + \row + \li enableBundledQt + \li \c true + \li Holds whether the Qt libraries that \QBS depends on will be bundled with \QBS during + the \c install step. This option is only implemented on macOS. + \row + \li useBundledQtScript + \li \c false + \li Use the bundled QtScript module instead of the one shipped with Qt. In that case, + QtScript should be checked out as a git submodule. + \row + \li libDirName + \li \c "lib" + \li Directory name used by \c libInstallDir and \c importLibInstallDir properties. + \row + \li appInstallDir + \li \c "bin" + \li Relative directory path under the install prefix path to put application binaries. + \row + \li libInstallDir + \li \c "bin" on Windows, \c libDirName otherwise + \li Relative directory path under the install prefix path where to put shared libraries + (excluding plugins, see the \c relativePluginsPath property). + \row + \li importLibInstallDir + \li \c libDirName + \li Relative directory path under the install prefix path where to put import libs. + \row + \li libexecInstallDir + \li \c appInstallDir on Windows, \c "libexec/qbs" otherwise + \li Relative directory path under the install prefix path where to put auxiliary binaries + executed by the \QBS libraries. + \row + \li systemSettingsDir + \li \c undefined + \li Directory that will be used by \QBS to store its settings. If not specified, a default + platform-dependent directory is used. + \row + \li installManPage + \li \c true on Unix, \c false otherwise + \li Whether to install man pages. + \row + \li installHtml + \li \c true + \li Whether to install HTML help pages. + \row + \li installQch + \li \c false + \li Whether to install qch files. See + \l{https://doc.qt.io/qt-5/qthelp-framework.html}{The Qt Help Framework} for details + about qch files. + \row + \li generatePkgConfigFiles + \li auto-detected + \li Whether to generate files for pkg-config. + \row + \li generateQbsModules + \li auto-detected + \li Whether to generate \QBS modules for the exported \QBS libraries. Use this when + building another product against \QBS libraries using \QBS as build system. + \row + \li docInstallDir + \li \c "share/doc/qbs/html" + \li Relative directory path under the install prefix path where to put documentation. + \row + \li pkgConfigInstallDir + \li \c libDirName + \c "/pkgconfig" + \li Relative directory path under the install prefix path where to put pkg-config files. + \row + \li qbsModulesBaseDir + \li \c libDirName + \c "/qbs/modules" + \li Relative directory path under the install prefix path where to put \QBS modules. + Applies only when \c generateQbsModules is \c true. + \row + \li relativeLibexecPath + \li \c "../" + \c libexecInstallDir + \li Path to the auxiliary binaries relative to the application binary. + \row + \li relativePluginsPath + \li \c "../" + \c libDirName + \li Path to plugin libraries relative to the application binary. + \row + \li relativeSearchPath + \li \c ".." + \li Relative path to the directory where to look for \QBS development modules and items. + \row + \li libRPaths + \li auto-detected + \li List of rpaths. + \row + \li resourcesInstallDir + \li \c "" + \li Relative directory path under the install prefix path where to put shared resources + like documentation, \QBS user modules and items. + \row + \li pluginsInstallDir + \li \c libDirName + \c "/qbs/plugins" + \li Relative path to the directory where to put plugins to. + \endtable + \section1 Using Docker A set of Docker images for developing \QBS (which are maintained by the \QBS team) is available @@ -523,8 +702,16 @@ The easiest way to get started is to build \QBS using a Linux container. These types of containers are supported out of the box on all the supported host platforms: Windows, macOS, - and Linux. Run the following to download the \QBS development image based on Debian 9 - \e Stretch: + and Linux. + + The images provide everything that is necessary to build and test \QBS: + + \list + \li Qt SDK for building \QBS with \c qmake + \li Latest stable release of \QBS for building \QBS with \QBS + \endlist + + Run the following command to download the \QBS development image based on Debian 9 \e Stretch: \code docker pull qbsbuild/qbsdev:stretch @@ -534,16 +721,19 @@ machine's file system, by running: \code - docker run -it -v $PWD:/qbs -w /qbs qbsbuild/qbsdev:stretch + docker run -it -v ${PWD}:/qbs -w /qbs qbsbuild/qbsdev:stretch \endcode - Or with a slightly different syntax for Windows: + You will now be in an interactive Linux shell where you can develop and build \QBS. + + For convenience, you can also run \c docker-compose from the project root directory: \code - docker run -it -v %CD%:/qbs -w /qbs qbsbuild/qbsdev:stretch + docker-compose run --rm stretch \endcode - You will now be in an interactive Linux shell where you can develop and build \QBS. + This will download and run the container in one go and mount the project root directory + to \c /qbs in the container. \section2 Windows Containers @@ -1686,6 +1876,12 @@ (which maps to \l{qbs::buildVariant}{qbs.buildVariant}), and \l{qbs::profiles} {qbs.profiles} (which maps to \l{Project::profile}{Project.profile}). + For example, to build a "fat" \c iOS binary containing two architectures, use the following + command: + \code + qbs build modules.qbs.targetPlatform:ios modules.qbs.architectures:arm64,armv7a + \endcode + \note The implementation details around multiplexing are subject to change. Product multiplexing works by examining the diff --git a/doc/reference/cli/cli-options.qdocinc b/doc/reference/cli/cli-options.qdocinc index 2d35bea61..d4c3280a2 100644 --- a/doc/reference/cli/cli-options.qdocinc +++ b/doc/reference/cli/cli-options.qdocinc @@ -496,6 +496,7 @@ \li \c msvc \li \c iar \li \c keil + \li \c sdcc \endlist //! [type] diff --git a/doc/reference/items/probe/sdcc-probe.qdoc b/doc/reference/items/probe/sdcc-probe.qdoc new file mode 100644 index 000000000..1353eb736 --- /dev/null +++ b/doc/reference/items/probe/sdcc-probe.qdoc @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Denis Shienkov <denis.shienkov@gmail.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ +/*! + \contentspage list-of-probes.html + \qmltype SdccProbe + \ingroup list-of-probes + \ingroup list-of-items + \keyword QML.SdccProbe + \inherits PathProbe + \brief Collects SDCC toolchain compiler information. + \since Qbs 1.14 + \internal + + Detects the version, supported architecture and the platform + endianness of the specified compiler executable file from the + \l{http://sdcc.sourceforge.net/}{SDCC} toolchain. +*/ + +/*! + \qmlproperty string SdccProbe::compilerFilePath + + An input property which is a full path to the SDCC compiler executable file. + + \nodefaultvalue +*/ + +/*! + \qmlproperty string SdccProbe::architecture + + Detected architecture of the target platform's processor. + + The possible values are \c "mcs51". + + \nodefaultvalue +*/ + +/*! + \qmlproperty string SdccProbe::endianness + + Detected endianness of the target platform's processor architecture. + + The possible values are \c "little". + + \nodefaultvalue +*/ + +/*! + \qmlproperty int SdccProbe::versionMajor + + Detected major compiler version. + + \nodefaultvalue +*/ + +/*! + \qmlproperty int SdccProbe::versionMinor + + Detected minor compiler version. + + \nodefaultvalue +*/ + +/*! + \qmlproperty int SdccProbe::versionPatch + + Detected patch compiler version. + + \nodefaultvalue +*/ diff --git a/doc/reference/modules/android-ndk-module.qdoc b/doc/reference/modules/android-ndk-module.qdoc index 8113a7c68..e3a7ca22d 100644 --- a/doc/reference/modules/android-ndk-module.qdoc +++ b/doc/reference/modules/android-ndk-module.qdoc @@ -47,7 +47,7 @@ CppApplication { name: "HelloJni" Android.sdk.packageName: "com.example.hellojni" - qbs.architectures: ["mips", "x86"] + qbs.architectures: ["arm", "x86"] files: "app/src/main/jni/hello-jni.c" } \endcode @@ -86,16 +86,9 @@ \list \li \c "c++_shared" \li \c "c++_static" - \li \c "gabi++_shared" (until r17) - \li \c "gabi++_static" (until r17) - \li \c "gnustl_shared" (until r17) - \li \c "gnustl_static" (until r17) - \li \c "stlport_shared" (until r17) - \li \c "stlport_static" (until r17) - \li \c "system" \endlist - \defaultvalue \c{"system"} + \defaultvalue \c{"c++_shared"} */ /*! @@ -111,5 +104,7 @@ The versioned platform name. - \defaultvalue \c{"android-9"} + \defaultvalue \c{"android-16"} for 32 bit arm ABIs + and \c{"android-21"} for all 64 bit ABIs and x86. + x86 ABI has broken wstring support in android-16 to android-19. */ diff --git a/doc/reference/modules/android-sdk-module.qdoc b/doc/reference/modules/android-sdk-module.qdoc index a9e06ae17..7733ae75d 100644 --- a/doc/reference/modules/android-sdk-module.qdoc +++ b/doc/reference/modules/android-sdk-module.qdoc @@ -161,6 +161,46 @@ */ /*! + \qmlproperty string Android.sdk::versionCode + + The Android Manifest version code of the respective product. The \c android:versionCode + attribute in the manifest file will be set to this value if not undefined. + + In the following example we provide an architecture-specific value + for \c android:versionCode: + + \code + // ... + property int _version: 1 + property int _patchVersion: 0 + Android.sdk.versionCode: { + switch (Android.ndk.abi) { + case "armeabi-v7a": + return 132000000 | _version * 10 + _patchVersion; + case "arm64-v8a": + return 164000000 | _version * 10 + _patchVersion; + case "x86": + return 232000000 | _version * 10 + _patchVersion; + case "x86_64": + return 264000000 | _version * 10 + _patchVersion; + } + throw "Unknown architecture"; + } + \endcode + + \defaultvalue \c undefined +*/ + +/*! + \qmlproperty string Android.sdk::versionName + + The Android Manifest version name of the respective product. The \c android:versionName + attribute in the manifest file will be set to this value if not undefined. + + \defaultvalue \c undefined +*/ + +/*! \qmlproperty string Android.sdk::resourcesDir The base directory for Android resources in the respective product. diff --git a/doc/reference/modules/protobufcpp-module.qdoc b/doc/reference/modules/protobufcpp-module.qdoc index 688f1d9e2..63c56c6ca 100644 --- a/doc/reference/modules/protobufcpp-module.qdoc +++ b/doc/reference/modules/protobufcpp-module.qdoc @@ -36,6 +36,25 @@ The \c protobuf.cpp module provides support for generating C++ headers and sources from proto definition files using the \l protoc tool. + A simple qbs file that uses protobuf can be written as follows: + \code + CppApplication { + Depends { name: "protobuf.cpp" } + files: ["foo.proto", "main.cpp"] + } + \endcode + A generated header now can be included in the C++ sources: + \code + #include <foo.pb.h> + + int main(int argc, char* argv[]) { + Foo bar; + bar.set_answer(42); + google::protobuf::ShutdownProtobufLibrary(); + return 0; + } + \endcode + \section2 Relevant File Tags \table diff --git a/doc/reference/modules/qbs-module.qdoc b/doc/reference/modules/qbs-module.qdoc index eea67688b..5d93aff4a 100644 --- a/doc/reference/modules/qbs-module.qdoc +++ b/doc/reference/modules/qbs-module.qdoc @@ -182,59 +182,93 @@ 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 \l{qbs::}{targetOS} - property for conditionals. For example, instead of: - + For example, a profile used for building for the iOS Simulator platform will have this + property set to the \c ios-simulator value: \code - qbs.targetPlatform === "macos" || qbs.targetPlatform === "ios" || qbs.targetPlatform === "tvos" || qbs.targetPlatform === "watchos" + profiles.xcode-iphonesimulator.qbs.targetPlatform: "ios-simulator" \endcode - use - - \code - qbs.targetOS.contains("darwin") - - \endcode - - However, in some cases using \c targetPlatform would be acceptable, such as - when the resulting condition would be simpler while still being correct: - - \code - qbs.targetPlatform === "linux" - \endcode - - versus - \code - qbs.targetOS.contains("linux") && !qbs.targetOS.contains("android") - \endcode + You should generally treat this property as \e{write-only} and avoid using + it to test for the current target OS. Instead, use the \l{qbs::}{targetOS} + property for conditionals. - The possible values include one or more of the following: + \section2 Relation between targetPlatform and targetOS - \list + This table describes the possible values and matching between the \c targetPlatform + and the \l{qbs::}{targetOS} properties: + \table + \header + \li Target Platform + \li Target OS + \row \li \c{"aix"} + \li \c{["aix", "unix"]} + \row \li \c{"android"} + \li \c{["android", "linux", "unix"]} + \row \li \c{"freebsd"} + \li \c{["freebsd", "bsd", "unix"]} + \row \li \c{"haiku"} + \li \c{["haiku"]} + \row \li \c{"hpux"} + \li \c{["hpux", "unix"]} + \row \li \c{"hurd"} + \li \c{["hurd", "unix"]} + \row \li \c{"integrity"} + \li \c{["integrity", "unix"]} + \row \li \c{"ios"} + \li \c{["ios", "darwin", "bsd", "unix"]} + \row \li \c{"ios-simulator"} + \li \c{["ios-simulator", "ios", "darwin", "bsd", "unix"]} + \row \li \c{"linux"} + \li \c{["linux", "unix"]} + \row \li \c{"lynx"} + \li \c{["lynx"]} + \row \li \c{"macos"} + \li \c{["macos", "darwin", "bsd", "unix"]} + \row \li \c{"netbsd"} + \li \c{["netbsd", "bsd", "unix"]} + \row \li \c{"openbsd"} + \li \c{["openbsd", "bsd", "unix"]} + \row \li \c{"qnx"} + \li \c{["qnx", "unix"]} + \row \li \c{"solaris"} + \li \c{["solaris", "unix"]} + \row \li \c{"tvos"} + \li \c{["tvos", "darwin", "bsd", "unix"]} + \row \li \c{"tvos-simulator"} + \li \c{["tvos-simulator", "tvos", "darwin", "bsd", "unix"]} + \row \li \c{"vxworks"} + \li \c{["vxworks"]} + \row \li \c{"watchos"} + \li \c{["watchos", "darwin", "bsd", "unix"]} + \row \li \c{"watchos-simulator"} + \li \c{["watchos-simulator", "watchos", "darwin", "bsd", "unix"]} + \row \li \c{"windows"} - \endlist + \li \c{["windows"]} + \endtable + + \sa {Target Platforms} \nodefaultvalue */ @@ -433,14 +467,57 @@ /*! \qmlproperty stringList qbs::targetOS + \readonly + + Contains the list of string values describing the OS and OS family that is + used to build a project. - Specifies the OS you want to build the project for. + This property is calculated based on the \l{qbs::}{targetPlatform} property and is typically + used to test for a particular OS or OS family in conditionals: + \code + Group { + // Includes all Unix-like platforms, such as: Linux, BSD, Apple platforms and others. + condition: qbs.targetOS.contains("unix") + files: ... + } + Group { + // Includes all Apple platforms, such as macOS, iOS, and iOS Simulator. + condition: qbs.targetOS.contains("darwin") + files: ... + } + Group { + // Includes only macOS + condition: qbs.targetOS.contains("macos") + files: ... + } + \endcode + Avoid using \l{qbs::}{targetPlatform} for this purpose. For example, instead of: - Use this property to test for a particular OS or OS family in conditionals. - Do not use \l{qbs::}{targetPlatform} for this purpose. + \code + qbs.targetPlatform === "macos" || qbs.targetPlatform === "ios" || qbs.targetPlatform === "tvos" || qbs.targetPlatform === "watchos" + \endcode + + use + + \code + qbs.targetOS.contains("darwin") + + \endcode + + However, in some cases using \l{qbs::}{targetPlatform} would be acceptable, such as + when the resulting condition would be simpler while still being correct: + + \code + qbs.targetPlatform === "linux" + \endcode + + versus + \code + qbs.targetOS.contains("linux") && !qbs.targetOS.contains("android") + \endcode - Possible values include one or more of \c{"bsd"}, \c{"darwin"}, and - \c{"unix"}, in addition to the possible values of \l{qbs::}{targetPlatform}. + For the complete list of possible values, see + \l{Relation between targetPlatform and targetOS}. \nodefaultvalue */ diff --git a/doc/reference/modules/qt-android_support-module.qdoc b/doc/reference/modules/qt-android_support-module.qdoc index f7ec595e3..995f73ba5 100644 --- a/doc/reference/modules/qt-android_support-module.qdoc +++ b/doc/reference/modules/qt-android_support-module.qdoc @@ -77,6 +77,15 @@ */ /*! + \qmlproperty stringList Qt.android_support::extraLibs + + Additional libs to be packaged and loaded on start-up (mind the order). + Corresponds to qmake's ANDROID_EXTRA_LIBS. + + \defaultvalue \c undefined +*/ + +/*! \qmlproperty bool Qt.android_support::verboseAndroidDeployQt Enable this property if you want verbose output from the diff --git a/doc/targets/qbs-target-platforms.qdoc b/doc/targets/qbs-target-platforms.qdoc index 8f37537b4..7e556aea9 100644 --- a/doc/targets/qbs-target-platforms.qdoc +++ b/doc/targets/qbs-target-platforms.qdoc @@ -45,4 +45,7 @@ \QBS recognizes the existence of at least AIX, HP-UX, Solaris, FreeBSD, NetBSD, OpenBSD, GNU Hurd, and Haiku, but provides no explicit support (except some minimal support for FreeBSD). + + For instructions on how to setup the target platform, see the + \l {qbs::targetPlatform}{qbs.targetPlatform} property. */ |