summaryrefslogtreecommitdiffstats
path: root/src/tools
Commit message (Collapse)AuthorAgeFilesLines
* moc: fix const-init for WindowsThiago Macieira2022-06-291-4/+3
| | | | | | | | | | | | | | | | | | | References to __declspec(dllimport) is not a constant expression on Windows, so we can't have a direct reference to a staticMetaObject. Commit 9b8493314dd77f3e96b353187816bb7ef4dedbb5 fixed the Q_OBJECT parent link (added in 5.14, kicked in for 6.0 with the ABI break), but commit 656d6f2a9b221dbd5adfc46262cb243e696d8d62 added links for Q_GADGETs too without taking the need for Windows DLLs into account. This change is a no-op everywhere but Windows. On Windows, since we store the pointer to the indirect getter function, now you may get non- null pointers from QMetaObject::superClass(). Change-Id: I6d3880c7d99d4fc494c8fffd16fab51aa255106e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 688e8f63a2bb87469517166f90c50dec524f90c5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: move the qt_static_metacall below the staticMetaObjectThiago Macieira2022-06-291-10/+11
| | | | | | | | | | Just so we have data structures and functions grouped together. Change-Id: Id0fb9ab0089845ee8843fffd16fa171f6e1caf2b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 9af59838d7ba166966941199354f905b0a122cab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* fix androiddeployqt with user application with in-tree QML modulesMoody Liu2022-06-281-4/+9
| | | | | | | | | | | | | | | | | | | | | | when deploying user applications with QML modules located under user's subdirectories, (e.g. some third-party QML components used as git submomdule). The qmldir for such QML modules will be, typically, generated under BUILD_DIR/android-qml. if a BUILD_DIR is under the source directory, androiddeployqt will skip those QML modules incorrectly because they "appeared to be under the QML root path so that seems can be imported", however without deploying them, it's impossible to import those modules on an Android device. this patch adds a check that also tests if a root path plus the module's url can actually lead to the correct module path, so a QML module under android-qml subdir would not pass the test, and thus won't be skipped. Task-number: QTBUG-103593 Change-Id: I8af76bd38cd55700e17794cf2fff0e50a90ac87e Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 8a96c8a22ca2c81969bb5e06249c06143b7f8249) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix an incorrect invocation of llvm-readobjVille Voutilainen2022-06-281-2/+2
| | | | | | | | | | | | | | | It's never been entirely sound or necessarily correct to use single-dash options for long options. Various other things invoked by androiddeployqt seem to provide only single-dash options, but llvm tools and GNU tools always provide a double-dash option. Therefore we can just change the --needed-libs option to use double-dash without any particular version checks or differences. Task-number: QTBUG-104580 Change-Id: I5649b0f9565989157d934c802da1f3c4c43fca0f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> (cherry picked from commit 40ddf2c7f34e429af4d18063ca947490cdc12ba9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Remove Gui dependency of androidtestrunnerAlexandru Croitor2022-06-271-2/+2
| | | | | | | | | | | It doesn't use any Gui classes and thus shouldn't depend on Gui. Also change PUBLIC_LIBRARIES to LIBRARIES, executables don't need to propagate library dependencies. Change-Id: I9edae7e555e1d74d63b00afbf9e3931963b502c2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 3eaf6a4cad4c12c1777cf7d5793e518f66f07780) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: properly indent the output for the metatype arrayThiago Macieira2022-06-251-34/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7ff7d73f6ac68227500fa95731ce0f04626e600b added the indentation, but there were a few mistakes and it was off by 4 spaces anyway. So re-do it and take the opportunity to add some comments to explain what we're seeing. Before: qt_incomplete_metaTypeArray<qt_meta_stringdata_QTimer_t, QtPrivate::TypeAndForceComplete<bool, std::true_type>, QtPrivate::TypeAndForceComplete<int, std::true_type>, QtPrivate::TypeAndForceComplete<int, std::true_type>, QtPrivate::TypeAndForceComplete<Qt::TimerType, std::true_type>, QtPrivate::TypeAndForceComplete<bool, std::true_type>, QtPrivate::TypeAndForceComplete<QTimer, std::true_type>, QtPrivate::TypeAndForceComplete<void, std::false_type> , QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<int, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type> >, After: qt_incomplete_metaTypeArray<qt_meta_stringdata_QTimer_t, // property 'singleShot' QtPrivate::TypeAndForceComplete<bool, std::true_type>, // property 'interval' QtPrivate::TypeAndForceComplete<int, std::true_type>, // property 'remainingTime' QtPrivate::TypeAndForceComplete<int, std::true_type>, // property 'timerType' QtPrivate::TypeAndForceComplete<Qt::TimerType, std::true_type>, // property 'active' QtPrivate::TypeAndForceComplete<bool, std::true_type>, // Q_OBJECT / Q_GADGET QtPrivate::TypeAndForceComplete<QTimer, std::true_type>, // method 'timeout' QtPrivate::TypeAndForceComplete<void, std::false_type>, // method 'start' QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<int, std::false_type>, // method 'start' QtPrivate::TypeAndForceComplete<void, std::false_type>, // method 'stop' QtPrivate::TypeAndForceComplete<void, std::false_type> >, Change-Id: Id0fb9ab0089845ee8843fffd16fa152d040ef922 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 3816b14ee8bc6f9722f3b76a32f968e334d0ed27) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* moc: put the qt_meta_stringdata_XXXX_t type in an unnamed namespaceThiago Macieira2022-06-251-1/+6
| | | | | | | | | | | | Not all user code is compiled with hidden visibility, so make sure one of the types in the template parameters (the one that is supposed to be unique anyway) is local and therefore causes the full symbol for the inline variable not to be exported outside of the translation unit. Change-Id: I6d3880c7d99d4fc494c8fffd16fb262a59b81283 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 8726647df40c61ed6d79da1e3845ef289bcf8b38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: remove the attempt to create one large string literalThiago Macieira2022-06-251-58/+30
| | | | | | | | | | | | | | | | | | | | | | | | Commit dda9c9e2bc4fd2efe9e3fb0e451a8c3512f9a4d2 fixed some outstanding issues with moc's calculation of the maximum string length, but it missed one. This commit instead opts to remove the calculation entirely and instead have multiple char array members in the qt_meta_stringdata. We needed a single string back in Qt 4.0 when the stringdata *was* a single char array. Since 5.0, we've used a structure with multiple members and pointer arithmetic going past the end of the arrays, from the top of the object. That's UB, but since it's always been UB and can't be fixed until Qt 7 anyway, let's go full monty on it and have one char array per meta object string. The struct qt_meta_stringdata_Qt_t for namespace Qt now has 1217 stringdataXXX members. Change-Id: I6d3880c7d99d4fc494c8fffd16fb0d1573e387dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 0978646a65f517f0026fbdd0639415d265876512) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: add Q_CONSTINIT to the static const variables we emitThiago Macieira2022-06-232-5/+13
| | | | | | | | | | | | The macro was added to Qt 6.4, so we define it in each moc output to empty if it wasn't previously defined. Thus, moc retains compatibility with older Qt versions. Change-Id: Id0fb9ab0089845ee8843fffd16f9c1539fa0368f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> (cherry picked from commit 116d8f987bfbb0ec1744fe6c2989f8f2a5756aba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: replace offsetof with sizeofThiago Macieira2022-06-231-1/+1
| | | | | | | | | | | It's the same thing since we have exactly one field in this structure before stringdata0. But there's a far smaller chance of producing a warning in user code. Change-Id: Id0fb9ab0089845ee8843fffd16f9cdceec33017d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9959cf60d360a43c87c77f44a7d17e2fae25a303) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: fix use of escape sequence of more than one characterThiago Macieira2022-06-231-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had the code to calculate the length, but were improperly using it only for the offset, not the length of the string or its containing array. That resulted in the generated moc output containing: QT_MOC_LITERAL(111, 5), // "\xffz" QT_MOC_LITERAL(114, 5), // "\0012" QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName" The two strings are described as occupying 5 bytes (length 4 + null terminator), which is incorrect. The offset was correct: 114 - 111 = 3 and 117 - 114 = 3. The new output is: QT_MOC_LITERAL(111, 2), // "\xffz" QT_MOC_LITERAL(114, 2), // "\0012" QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName" The effect of the array size calculation would only be felt if moc decided it needed a second string array (for strings over 65535 bytes), which would cause the offsets in the second array to be all wrong. There was no such test until now. Drive-by fixing of the newline, indentation, and the stale comment referring to QByteArrayData (Qt 5). Change-Id: Id0fb9ab0089845ee8843fffd16f9cd01b3e0709a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit dda9c9e2bc4fd2efe9e3fb0e451a8c3512f9a4d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: remove unnecessary emission of "#include <qbytearray.h>"Thiago Macieira2022-06-221-1/+0
| | | | | | | | | | | | | | | | | We don't need QByteArrayData any more (since 6.0). [ChangeLog][Potentially Source-Incompatible Changes] moc no longer emits an #include for QByteArray in the output file. None of the content that moc generates needed that header, so this should not cause changes for most people. However, codebases that #include'd the moc output (something that is recommended) could be depending on this indirect include. Change-Id: Id0fb9ab0089845ee8843fffd16f9cf13dc8d61b5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit cb0b1ee4417d67104c2c80e0c0c2d8a32e905df3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* moc: rename the "offsetsAndSize" member to "offsetsAndSizes"Thiago Macieira2022-06-221-2/+2
| | | | | | | | | | | | | | It contains more than one size. Drive-by drop the const from the structure, so it becomes properly trivial (though there's disagreement, see[1]). [1] https://conformance.godbolt.org/z/rK1xW669K Change-Id: Id0fb9ab0089845ee8843fffd16f9cc69ffd90aa4 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 3cf38290d9c459ecdbde9d6eb4dee09fc94f29a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typos in docs and commentsKai Köhne2022-06-152-2/+2
| | | | | | | | | | Found by codespell Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9d2cc4dd766ca6538e17040b6ac845ed880ab0fe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macdeployqt: macdeployqt process some libraries(e.g. ffmpeg) incorrectGuineng Ni2022-06-151-1/+7
| | | | | | | | | | | | ffmpeg and nettle are different from other libraries, they use symbol link as their inner module dependencies. Calling one more install_name_tool can handle this case. Fixes: QTBUG-100093 Change-Id: I12cdd53bd5aa3120910070ba283178686deb3eb0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 6dbe45c96a6b807cfc19c34cf2833504148d019f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* androiddeployqt: use QFile::exists instead of QDir().existsAlexandru Croitor2022-06-131-3/+3
| | | | | | | | | | Internally QDir().exists calls QFile::exists(filePath(name)) Change-Id: I2993d924268b10135bd9df4e9f8165b869946efc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit e2f14e5be702f89e3d54153fd7511c02729e014e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* androiddeployqt: Only pass qt_install_dir/qml directory if it existsAlexandru Croitor2022-06-131-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | In Conan's case, the qtbase installed package directory lacks a qml directory. We pass that as a valid qml import path via CMake -> deployment json file -> androiddeployqt -> qmlimportscanner which causes the qmlimportscanner to fail with qmlimportscanner: No such file or directory: "~/package/some_sha_1/qml" Invalid json output from qmlimportscanner. which in turn fails the androiddeploqt build step. Make sure to only pass qtbase_install_dir/qml if it actually exists. Amends 4ef3da04c3390f02bcb0507128372e6a299dc8fd Amends c08b9a49ba70b1cbb0704668dd3f2c487d7f585e Fixes: QTBUG-104056 Task-number: QTBUG-88519 Task-number: QTBUG-89588 Change-Id: I4310eb4e265ae8d3e3f09e1e1dbed79210e23de6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 0c82f98ec5c0135f3789f0f9c5e30978698ddff9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* uic: Fix string list properties for PythonFriedemann Kleint2022-05-261-10/+27
| | | | | | | | | | | | Use the opportunity to modernize the code to use an initializer list instead of stream operators. This then makes it easier to generate a comma-delimited list that works for Python as well. Fixes: PYSIDE-1942 Change-Id: I5291b55bd0685e06ad62e52c7ebccffce98e9c23 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Split qtLocalTime out into a new QLocalTime namespaceEdward Welbourne2022-05-201-0/+1
| | | | | | | | | | | | | | | ... in new qlocaltime* files, now that it's decoupled enough from the internals of QDateTime for this to be possible. Part of the consolidation of time_t code in one place. Move assorted constants from qdatetime.cpp to a private namespace in qdatetimeprivate_p.h to be shared between q*time.cpp hereafter (fixing an out of date comment in the process - julianDayFromDate() is long gone). Task-number: QTBUG-95993 Change-Id: I03d97e959118041f9d86b8bb2e738599bc0b17e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add option to not include native libraries in APKTinja Paavoseppä2022-05-202-19/+106
| | | | | | | | | | | | | | | | | Sometimes it is not desirable to include the libraries in the APK, e.g. system and vendor apps could prefer having one set of libraries installed on the device. If unbundled deployment is specified, native libraries will not be included in the APK. With unbundled deployment, optional arguments can be passed to set the path to load the libraries on the device. [ChangeLog][Android][Deployment Changes] Adds option for Unbundled deployment, where native libraries are not packaged in the APK. Task-number: QAA-771 Change-Id: Ica51ef83a24dad58c7586bf610a58abe21fc1100 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Make uic generate correct C++ commentsVolker Hilsheimer2022-05-181-1/+1
| | | | | | | | | Revert the change to uic of 05fc3aef53348fb58be6308076e000825b704e58. Task-number: QTBUG-67283 Change-Id: Icfd83bb6d80b91d4e58f1be460f6772ba49a6921 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* moc: Add line breaks to the qt_incomplete_metaTypeArray<>Friedemann Kleint2022-05-181-11/+14
| | | | | | | | The code is hard to read due to the long line generated. Task-number: QTBUG-100145 Change-Id: I1d1a7a547db71cca1e710d39df809f079fc2dafe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-16116-3389/+244
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Revert introduction of QT_USE_BOOTSTRAP_SOURCE_COPYJoerg Bornemann2022-05-091-115/+69
| | | | | | | | | | | | | | | | | | | | | | | This removes the hack that creates a copy of bootstraplib sources to avoid rebuilding the world if a bootstraplib source file changed. Said hack led to confusing behavior: - when accidentally editing bootstraplib copies instead of the real sources - when header files were changed in a way that were incompatible to the bootstraplib source copy This reverts commit 80a8ead08d1fea926850d1da61f693dfe26ed5b0. This reverts commit 743bb66744e762d10754426e43d42b24cc7bff0f. The official way to avoid the QTBUG-92269 problem is now to set QT_HOST_PATH=<host-Qt-installation> and QT_FORCE_FIND_TOOLS=ON. If you want to build the tools as well, set QT_FORCE_BUILD_TOOLS=ON. Fixes: QTBUG-92269 Change-Id: I226bf5792f9ca8e7e207dc53e01c2903018d82d3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Make possible building Qt tools without the use of core libraryAlexey Edelev2022-05-063-3/+3
| | | | | | | | | | | | | | Replace BOOTSTRAP option with the single value CORE_LIBRARY argument in qt_internal_add_tool and qt_internal_add_executable functions. The introduced argument now may accept 'Bootstap' and 'None' values. Use 'Bootstap' to link Qt::Boostrap library instead Qt::Core or 'None' to avoid any core library linking. This is useful for tools that need to use the CMake deployment routines, but not require the Qt::Core functionality. Task-number: QTBUG-87480 Change-Id: I64a8b17f16ac5fe43c6b385252dc21def0c88d2c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Tools: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-05-0310-41/+41
| | | | | | | Task-number: QTBUG-98434 Change-Id: Ie136f600f823019c29461561d4e30be66a66e87b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Tools: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-05-0320-303/+326
| | | | | | | | | As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Task-number: QTBUG-98434 Change-Id: I6d4712a71b5ebf3f379f1f98ea476557bce963ef Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Tools: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-05-0220-184/+180
| | | | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: Ib9e01ede4e0d7869fc95414d36f37df4a30b16b4 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* uic: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-266-10/+11
| | | | | | | | Task-number: QTBUG-98434 Change-Id: Ied042c0a61e48844694f6a94f0423735e92fb6d3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* uic: replace QLatin1String uses with _L1 or _sSona Kurazyan2022-04-2611-248/+264
| | | | | | | Task-number: QTBUG-98434 Change-Id: I5a9b01d1dd2a2a727cfb71e829dbf631bf25e2db Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* macdeployqt: Ignore repeated references to binary when parsing otool -LTor Arne Vestbø2022-04-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | macdeployqt doesn't know or care about universal build (yet), and will just scan all the lines produced by otool -L as if they were for a single architecture, ignoring any lines it doesn't recognize. This fails when the second arch starts off with a reference to the binary we're processing, which then gets interpreted as a dependency of itself. If that binary doesn't have a path, we end up looking for a match in /usr/lib, which we can't find in the best case, or actually end up deploying from an incompatible Qt version in the worst case. Ideally we'd teach macdeployqt about the multiple slices, bur for now we work around it by skipping any references to dependent libraries that match the binary itself. Fixes: QTBUG-102607 Pick-to: 6.2 6.3 5.15 Change-Id: Ia039fafdce90896e61aab90b9c8ac52543cc2c8c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* uic: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-238-27/+26
| | | | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: I0d3c232a9fa95aea854445922f100b89c6d6f5a1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Android: use Qt major version for detecting OpenGL and QtQuick librariesSona Kurazyan2022-04-221-2/+4
| | | | | | | Change-Id: Ia7651ad09d7aab70cf32fcd56f9fb75202ace768 Pick-to: 6.3 6.2 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adapt generated sources of uic to latest string changesFriedemann Kleint2022-04-221-612/+615
| | | | | | | | | | Use _s literals everywhere, removing all codepaths generating QLatin1Strings for comparisons and other optimizations. This is now possible since string literals are now longer duplicated. Task-number: QTBUG-98434 Change-Id: Ie35199593dc13a36afd92e3a0dd8d58ec492e4b7 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix unresolved include in bootstraplib when using source copiesJoerg Bornemann2022-04-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | When QT_USE_BOOTSTRAP_SOURCE_COPY is ON, there are situations where includes like "../../3rdparty/sha1/sha1.cpp" in qcryptographichash.cpp cannot be resolved. For example, out-of-source MSVC builds are affected. In-source builds are working by accident, because we're adding the include path "<qtbase-build-dir>/src/corelib/global", and <qtbase-build-dir> is <qtbase-source-dir>. Linux/macOS builds are working by accident, because we're adding the include path "<qtbase-source-dir>/src/3rdparty/forkfd". Fix this by explicitly adding the directory where qcryptographichash.cpp resides to INCLUDE_DIRECTORIES. This amends commit 743bb66744e762d10754426e43d42b24cc7bff0f. Fixes: QTBUG-102720 Change-Id: I55fcc186ea4c81134c39023ced3f04458230109b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: de-duplicate shellquote helpers code in deploy and test toolsAssam Boudjelthia2022-04-214-144/+112
| | | | | | | | Move shellquote helper functions into a common place instead of having a copy in each tool's code. Change-Id: I9723c11f894a211864788a7635773610c0fde739 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Android: remove what appears to be non-necessary debug print leftoversAssam Boudjelthia2022-04-212-3/+2
| | | | | Change-Id: Ib87c6ada78180dcc686d24a048dbcfa159cac974 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Android: add helper functions to append .exe/.bat suffix when neededAssam Boudjelthia2022-04-211-86/+76
| | | | | | | | Instead of having to do that each time for multiple paths, a common helper function is better. Change-Id: Ice2499f390a5790c5768eca037d186ad2e656ec7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Android: remove unused function in androiddeployqtAssam Boudjelthia2022-04-211-58/+1
| | | | | | | | The "android" tool is deprecated and never used now, and this function is not called by anything either. Change-Id: I6fdb09934c93f5bc03610bcc4fd677f8bb2d4189 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Android: remove the old copy of gradle.properties after reading itAssam Boudjelthia2022-04-211-3/+5
| | | | | | | | | | The file is going to be remove anyways in the next build, so just delete it once we're done with it, this also makes the build folder doesn't have files that are not needed. Pick-to: 6.2 6.3 5.15 Change-Id: I948f028e9151b38a3ccc1ec628239ac91397e0d0 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Replace uses of _qs with _s in sources and examplesSona Kurazyan2022-04-191-8/+10
| | | | | | Task-number: QTBUG-101408 Change-Id: I48360ba3b23965cd3d90ac243c100a0656a4cde8 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Android: use libexec path for qmlimportscannerAssam Boudjelthia2022-04-191-3/+5
| | | | | | | | This should've been done already for Qt 6.2. Pick-to: 6.2 6.3 Change-Id: I2f943254698a4f0f2742619fd7fcab9ac3a5014a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-142-7/+7
| | | | | | | | Task-number: QTBUG-98434 Change-Id: I35a97eef61746039738b4a5f2271c3bffd5711b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-142-320/+317
| | | | | | Task-number: QTBUG-98434 Change-Id: I5ee5fe079c9a4530f636e59f6171abfa523591f4 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-142-73/+71
| | | | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: Iebcbdbd7cecac09d0a7039e3ef6a4509d33039ba Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Avoid rebuilds when changing sources belonging to bootstraplibJoerg Bornemann2022-04-131-69/+111
| | | | | | | | | | | | | | | | | | | | | | | Whenever a source file is touched that belongs to the bootstrap library, all bootstrap tools are rebuilt. This includes moc. The moc binary however, is a dependency whose invalidation results in a rebuilt of quite some parts of Qt. There's no easy way to turn off this dependency. To mitigate the rebuilds, the bootstrap lib now can use a copy of the corelib sources. That means the bootstrap lib is not rebuilt if its sources are changed. This is basically the situation we had in Qt5. The sources are not updated on reconfiguration. There's a new target 'update_bootstrap_sources' that can be built to update the copied source tree of the bootstrap lib. This new behavior can be controlled with the variable QT_USE_BOOTSTRAP_SOURCE_COPY. It's on by default for developer builds. Fixes: QTBUG-92269 Change-Id: I50234df66590c39594d208424394c7a600dc5606 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: fix androidtestrunner failure parsingAssam Boudjelthia2022-04-061-39/+100
| | | | | | | | | | | | | | | Make sure androidtestrunner reports the following cases as failures: * XPASS test case * The test output doesn't have closing block. * The test result read from output.txt is empty Pick-to: 6.2 6.3 Fixes: QTBUG-100312 Task-number: QTBUG-100470 Change-Id: Ifbb3c31fa22159df0c39b264e95e2f1ccd16e5ff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* moc: Add --debug-includes option to mocAlexandru Croitor2022-04-053-4/+56
| | | | | | | | | | | | Because moc silently ignores missing headers, or sometimes includes the wrong header, it is useful to have a facility to print which header paths were considered and found. Add a new --debug-includes option that does that. Task-number: QTBUG-101775 Change-Id: I72b294ae53d6e47252c7d8afe0f2245da78bfadb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Extend androidtestrunner default timeout to 8 minutesAndreas Buhr2022-04-051-1/+1
| | | | | | | | | | | | | | | | | | qmake had a feature to set androidtestrunner's timeout. This feature is not yet ported to CMake. So with CMake, we always have androidtestrunner's default timeout. Which was five minutes. We have several tests which take just shy of five minutes and are thus flaky. This patch extends the timeout to eight minutes. This should be a temporary workaround until the timeout feature is implemented in CMake. Task-number: QTBUG-101596 Pick-to: 6.2 6.3 Change-Id: Ia67ed6ab40a40f1b82861bd15bd04528ee9334ee Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Throw an error if project uses versioned shared libraryAlexey Edelev2022-03-301-4/+20
| | | | | | | | | | | | | | | | | | | | Android internally cannot handle versioned shared libraries. There is no explicit rule for that, but indirect signs point to this. This adds an explicit error to androiddeployqt to give the clear understanding of the error nature to user. Error is also thrown if versioned library was used when linking Qt libraries. E.g. when linking Qt with liba.so it might be symlink to liba.so.1.0 This means that liba.so.1.0 Qt will require liba.so.1.0 at runtime. But since Android doesn't handle versioned shared libraries, liba.so.1.0 will never be packaged correctly. Most build systems support generating of versionless shared libraries, and this should be used when building 3rdparty libraries for Android. Task-number: QTBUG-101346 Change-Id: Ic49d1a0d7d3a4c5c0dc308a570e98e8a0a223053 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>