aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/tools/vsenvironmentdetector.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix/suppress compiler warnings with Qt6/MSVCOrgad Shaneh2022-03-251-1/+1
| | | | | Change-Id: Ic3a13c71a841a3e6c31a2c6d06c79836a54318fb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix Clang-Tidy & Clazy 'llvm-else-after-return' warningsDenis Shienkov2021-11-221-4/+2
| | | | | Change-Id: I16649525d797c980c0ba1357b3671b683c4fde25 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* msvc: Pass -vcvars_ver to vcvarsall.bat when detecting environmentIvan Komissarov2021-04-231-0/+3
| | | | | | | | | This is required to properly support multiple MSVC toolchains (also now supported). Fixes: QBS-1498 Change-Id: I1274379496d47ebf7842eaed05f498b7af111b5b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Allow to specify windowsSdkVersionIvan Komissarov2021-04-191-2/+4
| | | | | | | | | Previously, it was not possible to use older windows SDK version. Fix that by introducing the new property that is passed to vcvarsall.bat Task-number: QBS-1498 Change-Id: Ic526eabb8ff82ddd85c93e90fd20421595a121f4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove deleting trailing slash from VS env varsSergey Zhuravlev2020-05-191-2/+0
| | | | | | | | | | | | | After launching msbuild from QBS I got an error "LOGGERBASEDEXECTASK : ILC error ILC1004: Directory 'C:\Program Files (x86)\Windows Kits\10lib\10.0.15063.0\um' passed to argument 'targetplatformsdklibpath' does not exist.". Seems those trailing slashes are important. Change-Id: I2839d7054c866207bbaeef3e21a4ea6a9679f477 Fixes: QBS-1551 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Merge branch '1.15' into masterRichard Weickelt2020-02-051-0/+2
|\ | | | | | | Change-Id: I7e348db380b836221db79c73ea3b5f1d891f114b
| * MSVC: Avoid bad execution attempt of powershellOrgad Shaneh2020-01-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | If the user opted in for telemetry, vsdevcmd.bat tries to execute powershell. The batch file clears the PATH, so powershell cannot be used. Change-Id: I80e457aebea9d8c1c8ba0415d50d809bfd0bd4da Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Adapt source code to Qt 6Christian Kandeler2019-12-171-2/+3
|/ | | | | | Change-Id: If84e3e4c832c2b3dc39e40be13e989996ab764d1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix build errors when cross-building Qbs with MinGW on LinuxRichard Weickelt2019-05-241-1/+1
| | | | | | | | | | Linux file systems are case-sensitive while Windows file systems are usually not. That results in build errors when includes or libraries are incorrectly cased. Such errors wouldn't be noticed on Windows, but only when cross-building Qbs with MinGW on Linux. Change-Id: I3a340f907deaaf75b91369330d35918d70de56ca Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add support for the clang-cl compilerIvan Komissarov2019-04-101-2/+11
| | | | | | Task-number: QBS-1316 Change-Id: Ibf9da364610c260ead088a8990a70c7739d53c39 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix calls to non-const begin()/end() in range-for loopsIvan Komissarov2019-03-061-4/+8
| | | | | | | | This fixes -Wclazy-range-loop Change-Id: I08a435b700017cdbe27fbfdbda6e26840d9a3568 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Return initializer list where it is possibleDenis Shienkov2019-02-261-3/+3
| | | | | | | | | 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-3/+3
| | | | | | Change-Id: I7419cc3fbc1e8776de3943852dcedab4c95d1c32 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* MSVC: Add support for the Visual Studio 2017 Build ToolsChristian Kandeler2018-10-081-1/+1
| | | | | | | | | | | | | | This entails: - Auto-detection: The Build Tools no longer have an entry in the registry; use the vswhere tool instead. - Unset the VSINSTALLDIR environment variable before calling the vcvarsall.bat script, as this variable can confuse the msbuild.bat sub- script if it is set. - Look for the base include directory two levels above the directory under which cl.exe is located. Change-Id: Id8f7976e5f41015e59850d3ed68fa81b6ce701a2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* MSVC Probe: Expose WindowsSDKVersion and WindowsSdkDirJoerg Bornemann2018-07-101-1/+2
| | | | | | | | Those two environment variables are needed for the WinRT build of Qt. Task-number: QTBUG-68144 Change-Id: Ib07c86971ffb7951b2c533b6e900bf6247e9f08f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* corelib: Gather string constants in central placeChristian Kandeler2017-11-291-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same string literals appeared over and over again in the code base, causing redundancy in the sources as well as at run-time. We now give them a name and make sure they get instantiated at most once. String literals that occur only once are converted from QLatin1String to QStringLiteral unless they appear only in contexts that make use of QLatin1String overloads or they are clearly outside of any hot code paths. This seems to result in small, but measurable performance improvements, even if we assume the 1% changes to be noise: ========== Performance data for Resolving ========== Old instruction count: 3266514138 New instruction count: 3209355927 Relative change: -2 % Old peak memory usage: 29649896 Bytes New peak memory usage: 29436264 Bytes Relative change: -1 % ========== Performance data for Rule Execution ========== Old instruction count: 3367804753 New instruction count: 3319029596 Relative change: -2 % Old peak memory usage: 19577760 Bytes New peak memory usage: 19091328 Bytes Relative change: -3 % ========== Performance data for Null Build ========== Old instruction count: 608946535 New instruction count: 604566001 Relative change: -1 % Old peak memory usage: 14606384 Bytes New peak memory usage: 14579936 Bytes Relative change: -1 % Change-Id: Ia055a52e0a4b6fe6fd0f1e7ba4bfa583cba1b0ef Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Use nullptr to initialize the pointersDenis Shienkov2017-11-201-1/+1
| | | | | | Change-Id: I59d743f585410cb5c00d36a7b6f9a3e9d696d19e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Provide more detailed error message when failing to find vcvarsall.batJake Petroules2017-11-171-5/+20
| | | | | Change-Id: I171122d53e823277850abb4be05376d3fa528d85 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix return value of VsEnvironmentDetector::startJoerg Bornemann2017-10-121-3/+6
| | | | | | | | This function always returned true. Instead, it should return false if all detection attempts failed. Change-Id: I9bf15f6b4f4448570e362dd232e1cdd7dc244760 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove superfluous qAsConst callJoerg Bornemann2017-10-121-1/+1
| | | | | Change-Id: I132e653dc29901d27d6d687905894b6a6108e5cc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace all uses of QVector with std::vectorJake Petroules2017-03-291-10/+11
| | | | | Change-Id: Idd41fc4d9819649a85739f984862bed6480fddd5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove all usages of Q_FOREACH from the libraryChristian Kandeler2017-02-211-4/+5
| | | | | | | | This will make it easier to experiment with exchanging Qt containers for STL ones, for instance. Change-Id: Ie591fa54b5241ad4841b1ebcfb78b72932cd2b38 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Change style of #includes of Qt headersJake Petroules2017-01-041-6/+6
| | | | | | | | | | | | | | | | 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>
* Make Win32 API usage long-path awareJake Petroules2016-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | Most Win32 API functions are limited to working with paths which are up to MAX_PATH (260) characters long by default. Windows 10 version 1607 allows this limit to be exceeded by setting a LongPathsEnabled registry key and manifesting the application with the longPathAware=true setting. We cannot rely on this being the case since we support older Windows versions and the registry key is set to off by default. Fortunately, most Win32 API functions allow prepending the \\?\ prefix which raises the path length limit to UNICODE_STRING_MAX_CHARS (32767) characters. This works on all Windows versions. For the FileInfo class in particular, this resolves potential false negatives for file existence, inability to retrieve modification times, and misidentification of directories as files. Task-number: QBS-1068 Change-Id: Ia4a37fa75ede803e3e2ecb63ae1ab12d2dae33bd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add VS 2017 supportJoerg Bornemann2016-12-021-4/+26
| | | | | | Task-number: QBS-1025 Change-Id: Ib08373b6b45fa0b728e68466d08d43a14f864d72 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Refactor MSVC toolchain detectionJoerg Bornemann2016-11-101-22/+47
| | | | | | | | | Have one MSVC object per MSVC installation instead of one MSVC per VS installation with some list members. This cleans up the code quite a bit and prepares for VS 15 support and speed improvements. Change-Id: Idf6759e5b05584532f56be4036c87df310363bd3 Reviewed-by: Christian Kandeler <christian.kandeler@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>
* Determine Visual Studio architecture & build environment automatically.Jake Petroules2016-06-271-0/+191
This moves one step further to making the setup-toolchains tool unnecessary and also makes the toolchainInstallPath of MSVC profiles consistent with what Qt Creator sets. Change-Id: I3eb11b456bf02bde8993ec0dac7e0f9950174a08 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>