aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/qbs-setup-qt/setupqt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Do not use std::string in HostOsInfoIvan Komissarov2022-02-041-1/+1
| | | | | | | | We are not going away from Qt and converting QString to std::strgin and vice versa does not make any sense. Change-Id: I99c0067a4738566728c503fe39f0d0a945d4e977 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace std::erase && std::remove_if chains with Internal::remove_ifDenis Shienkov2021-12-221-4/+1
| | | | | Change-Id: Ia267b9419227db5f4382a33aa99eb7dbe0ada45f Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Replace missing std::any_of with Internal::any_ofDenis Shienkov2021-12-021-1/+1
| | | | | Change-Id: Ic17ce136f1438dbdc4cf1d5c88947d004748fd70 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add missing std:: namespace for all functions from <cstdio> libraryDenis Shienkov2021-12-011-1/+1
| | | | | Change-Id: Ia5c14b86e5e0952dbebf103c5355f49e41158cba Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Get rid of Set::to/from methodsIvan Komissarov2021-08-161-3/+4
| | | | | | | | | ... and replace them with the new template rangeTo method Also, add efficient Set(Iter, Iter) ctor. Change-Id: I5a2345ca84373692e3ba815e5a8f38cb4cfc4308 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* setup-toolchains now sets the qbs.toolchainType, not qbs.toolchainIvan Komissarov2020-03-091-3/+9
| | | | | Change-Id: I21f0626a093db358f8f5dfa6248672c44edc82e2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add Visual Studio 2019 support1.13Joerg Bornemann2019-06-071-1/+1
| | | | | | Fixes: QBS-1451 Change-Id: I644835cf8ce18d546e6c8e2c75f689766456555d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* setup-qt: Fix magic MSVC version number used for compatibility checkChristian Kandeler2019-03-181-1/+1
| | | | | | | MSVC 2017 starts at 19.1, not 19.10. Change-Id: Ib65d36ca19af829c8e616f40db6bcb11d9b288f0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Return initializer list where it is possibleDenis Shienkov2019-02-261-7/+7
| | | | | | | | | This fixes this clang-tidy warning: warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] Change-Id: I421e1e47462fe0e97788672684d47943af7df850 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use QStringLiteral more where it is possibleDenis Shienkov2019-02-251-17/+17
| | | | | | Change-Id: I7419cc3fbc1e8776de3943852dcedab4c95d1c32 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* setup-qt: Fix detection for 32-bit MSVCChristian Kandeler2019-02-131-1/+3
| | | | | | | | The installer directory names do not contain the architecture in that case. Change-Id: I072df4260eefff7dd15d90770c73e1187e7f72cc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Detect Qt via a module providerChristian Kandeler2019-02-121-228/+83
| | | | | | | | | | | | | | | | | Creation of qbs modules for Qt is now done on demand during project resolving. The qmake executable(s) are looked up via PATH or taken from the Qt.qmakeFilePaths provider property. As a result, Qt projects can now be built without a profile. The qtprofilesetup library is gone; its code is now in the module provider. I kept the C++ -> JavaScript conversion as straightforward as possible and mostly resisted the temptation to "optimize". The setup-qt tool still exists and mainly sets Qt.qmakeFilePaths. [ChangeLog] It is no longer required to call setup-qt before building Qt projects. Change-Id: I5b7e4711ec47b996911c499f29d8129d90e4731e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qtprofilesetup: Understand the mkspec prefix "mingw"Christian Kandeler2018-10-181-5/+5
| | | | | | | E.g. Fedora provides "mingw-w64-g++". Change-Id: Ife197baa8ddd1b364025056b1ec7895a0b60d5dc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix VS toolchain compatibility matchingJoerg Bornemann2018-06-081-1/+8
| | | | | | | | | | VS 2017 15.0 (_MSC_VER 19.10) builds of Qt are compatible with later Visual Studios of the same major version, e.g. VS 2017 15.7 (_MSC_VER 19.14). Change-Id: I7635f6e2be6591245c1056045128e546c23bacd2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Move msvcVersion out of QtEnvironmentJoerg Bornemann2018-05-241-9/+10
| | | | | | | | | This member is only used in qbs-setup-qt and is possibly invalid when used from Qt Creator. The removal stops us from trying to use the member in the qtprofilesetup lib again. Change-Id: Ib356b0f69fe479321aa7c3148acdb95fb805239a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Move MSVC-related functions to qtprofilesetup libJoerg Bornemann2018-05-241-35/+1
| | | | | | | This will avoid code duplication in the next commit. Change-Id: I90d99860dce04bf56c81d4f363aa6e5bafe1224c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace some uses of find_if with any_of and none_ofJoerg Bornemann2018-01-171-4/+4
| | | | | | | | | | Calls to find_if that just compare the result with an end iterator are replaced by calls to any_of or none_of. This leads to shorter, more expressive code. For increased readability, versions of any_of/none_of are provided that operate on whole containers instead of iterators. Change-Id: Ia4ff449176f22f1820635e810724983866d3265e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make Version a public classJake Petroules2017-12-011-1/+0
| | | | | | | It's already exposed in public API; i.e. via qtprofilesetup headers. Change-Id: I56950ce3163e6c5bd2c3fd08cc885b35723be5a7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Constrain Qt modules also to qbs.targetPlatformJake Petroules2017-11-291-46/+0
| | | | | | | | | | | This makes it possible to have multiple Qt versions for different platforms in the same module search path (much like multiple Android archs are present in the same module search path). This enables scenarios like building a Qt-based iOS and watchOS project in the same build configuration without messing with profiles. Change-Id: I448d7a768e8576373ff91d5283d46dbd7b8969ca Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace 'foreach' macro with range-based 'for'Denis Shienkov2017-11-241-9/+12
| | | | | Change-Id: I34479bc9673d0202363aeba5c7919efc8f0d7287 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add qbs.targetPlatform and qbs.hostPlatform propertiesJake Petroules2017-11-221-44/+34
| | | | | | | | | | | | | | | | | 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>
* STL compatibility: use cbegin/cend() instead of constBegin/constEnd()Jake Petroules2017-11-221-2/+2
| | | | | Change-Id: I363e4d85e60c1c8ea1c0661d5088a7b8e1a5b806 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use push_back() instead of append()Jake Petroules2017-11-221-2/+2
| | | | | | | | | | ...or operator<< if the argument was itself a list, or brace init where appropriate. This is a simple find and replace with manual sanity check. Change-Id: I94b79cbf3752192dd258001bf1dfcd46f58ca352 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use empty() instead of isEmpty()Jake Petroules2017-11-161-4/+4
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Iab6d46dcc3be246d1650aae2b1730f933b717be8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use size() instead of count()Jake Petroules2017-11-151-2/+2
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Ia733befe7885dc3c643d5c84e151312bfd86a3c6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* STL compatibility: use front() instead of first()Jake Petroules2017-11-141-2/+2
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: I82f0eb38b6a5a3b75a4ed38d97bdb6ce164d09b3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add initial support for Universal Windows PlatformJake Petroules2017-08-011-3/+1
| | | | | | | | | | | [ChangeLog] Added initial support for the Universal Windows Platform (properties for which API families/partitions are available to code being compiled, and whether compiled binaries require an app container context to load/execute). Change-Id: Idd3e117bbb40bd547ae06c16318b2d2e38f07bb4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove references to obsolete platformsJake Petroules2017-07-251-7/+0
| | | | | | | | | We'll never support Windows CE, Windows Phone (8.x), or BlackBerry. Change-Id: I4adceb663098799f4a8e7283059add6ed9c15f1f Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix the auto-connection of Qt profiles to toolchain profilesJoerg Bornemann2017-06-131-9/+5
| | | | | | | | | | | The isQtProfile function always returned false, because Qt profiles do not have Qt.* properties set anymore. Look for a "modules/Qt" subdirectory below the search paths instead. Change-Id: I53590f1889f416b52aee1ab22d5c69ea2d5e1d39 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* setup-qt: Fix automatic base profile assignment for MSVC Qt'sJoerg Bornemann2017-06-091-46/+62
| | | | | | | | | | Read MSVC version from qconfig.pri instead of trying to guess it from the mkspec name. The latter is broken since the introduction of the common win32-msvc mkspec for all MSVC versions. Change-Id: I24bd2d5b4935dbba2e296b15d4e6a553393eca3a Task-number: QBS-1141 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* setup-qt: compress MSVC profiles even when Qt's MSVC version is unknownJoerg Bornemann2017-06-091-8/+25
| | | | | | | | | | | | | | | | | "Compressing" MSVC profiles means that if MSVC2017-x64 and MSVC2017-x86_x64 fully match, then we drop MSVC2017-x86_x64 and connect the Qt profile to the former. This compression took place only if there was a valid Qt version. Do the compression always now, and take care that we throw out the right cross-compiler toolchains. While this patch does not fully fix QBS-1141, it alleviates the symptoms if only one MSVC is installed, which is usually the case. Task-number: QBS-1141 Change-Id: Ied766b6051074fbb92037185f2a357bcdbc55b68 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Replace all uses of QSet with Internal::SetJake Petroules2017-03-221-11/+15
| | | | | Change-Id: I0ba0a39b4f7d8c7c76b869584317b53b85cffc81 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix detection of framework builds of QtJake Petroules2017-02-241-7/+2
| | | | | | | | | This fixes detection of static builds of Qt on Apple platforms, for example. Qt 5.8 broke this since qt_no_framework no longer exists. The else case was never *really* necessary anyways. Change-Id: I038108ccd0f977d71c7fd656e83f4864aab3393e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Change style of #includes of Qt headersJake Petroules2017-01-041-8/+7
| | | | | | | | | | | | | | | | By using q<lowercase>.h headers, we become more bootstrap-friendly, as no full syncqt is required any more. In the same go, prefix all includes with the module name. This helps grep-based analysis of which parts of Qt are used and where. It's also consistent with Qt's public headers (where syncqt enforces the style). Testdata and examples are excluded from the change, as they are not relevant for bootstrapping. Change-Id: I9539b1d795e87fca6e5fc6c91acbb775b79208d9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add VS 2017 supportJoerg Bornemann2016-12-021-0/+2
| | | | | | Task-number: QBS-1025 Change-Id: Ib08373b6b45fa0b728e68466d08d43a14f864d72 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix VS Qt version matchingJoerg Bornemann2016-11-301-3/+5
| | | | | | | | We must not compare the full compiler versions, but only the major and minor versions. This amends 26c5cbc1. Change-Id: I8e48047ce70ba237fdbb1a8593f2469b2eb7d60a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Prepare VS Qt version matching for VS 2017Joerg Bornemann2016-11-301-18/+18
| | | | | | | | Comparing major versions is not enough for VS 2017 since its compiler has the version number 19.1. Change-Id: I689e2d5399661ed7fe323eea0215d92ea4560e1a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.6 into masterChristian Kandeler2016-09-051-3/+1
|\ | | | | | | Change-Id: Ica9e01e8dc03fe0d36568a270bbad9b85919c952
| * setup-qt: Fix toolchain profile look-upChristian Kandeler2016-09-011-3/+1
| | | | | | | | | | | | | | | | Since commit 87a1478921, we no longer set qbs.architecture in the toolchain profile, but setup-qt still expected it. Change-Id: Id52c087cd91fa08768bf62a4f9d4850d676fe41a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Update license headersIikka Eklund2016-08-291-14/+23
|/ | | | | | | | | | Patch-set 2 includes *.cpp *.c Every source file needs to have up-to-date license headers in order to pass ci. Change-Id: Ie6e493097af6f7dd6a8adff170eb856f496e689e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge 1.5 into 1.6Jake Petroules2016-06-281-2/+2
|\ | | | | | | Change-Id: If1a2c368170d89d5e6e11b08a32b37901d51eb1d
| * Do the OS X to macOS rename.v1.5.2Jake Petroules2016-06-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog] The "osx" value in qbs.hostOS and qbs.targetOS has been replaced with "macos". For backwards compatibility, qbs.hostOS will still contain "osx" in addition to "macos", and an error will be printed if qbs.targetOS contains "osx" but not "macos". Specifying "macos" without "osx" is allowed. These checks are subject to be removed in a future version of qbs, so update your hostOS and targetOS checks accordingly. [ChangeLog] cpp.minimumOsxVersion has been deprecated and replaced with cpp.minimumMacosVersion. cpp.minimumOsxVersion is subject to be removed in a future version of qbs, so update your projects accordingly. Change-Id: I479891829dff6eb6750cb2a04e1395f085896f63 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Fix base profile setup for MSVC Qt profilesJoerg Bornemann2016-06-271-8/+37
|/ | | | | | | | Filter out cross-compiler toolchains like x86_amd64 if the native toolchain (e.g. amd64) is available. Change-Id: I0fb9cfc6b0389aa87e15a5c0ec3511a4cc43ae00 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Replace 'the Qt build suite' with 'Qbs' in copyright notices.Jake Petroules2016-06-061-1/+1
| | | | | | Change-Id: I885d94bb14b325dc36767a840ebdb0be1fb59dd2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make base profile matching work for Xcode + OS X.Jake Petroules2015-08-031-29/+37
| | | | | Change-Id: Ib6eee7c77a0016e8b93c21eb2527a37277fe7d72 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Fix compilation with MSVC 2010.v1.4.1Christian Kandeler2015-06-181-9/+9
| | | | | | | Still required for Qt Creator 3.4. Change-Id: I016c5969eef526fd61c19e18ea03bb8442811e8f Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* setup-qt: Fix mkspec name extraction for Qt4/mingw.Christian Kandeler2015-06-171-0/+5
| | | | | Change-Id: I21d6a98176a029ea58b9e828ffc909445e4bb0c2 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* setup-qt: Relax toolchain compatibility requirements.Christian Kandeler2015-06-161-18/+45
| | | | | | | | | Don't require a 100% match of qbs.toolchain. Now clang toolchains get considered as a possible base profile for a Qt with a linux-g++ mkspec. Change-Id: I2ff23873c71f24930b1cf48802151709e42c6039 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* let setup-qt detect qmake-qt4 and qmake-qt5 executablesJoerg Bornemann2015-05-111-7/+18
| | | | | | | | | Some Linux distributions provide qmake binaries that are called qmake-qt4 and qmake-qt5. Let setup-qt find those in auto-detection mode. Change-Id: Iaf3ac087ab05201a4d2823629236b46167e6e1c1 Task-number: QBS-745 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* fix buildJoerg Bornemann2015-05-061-1/+1
| | | | | Change-Id: I33be530bb3095100311f5a1cc36b202ce5d10b87 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>