The warnings are shown when configuring any Qt submodule or top-level.
The warnings are NOT shown when configuring a user project with CMake.
Opt out CMake cache variables can be set to silence any of the
warnings:
- QT_NO_APPLE_SDK_AND_XCODE_CHECK
- QT_NO_APPLE_SDK_MIN_VERSION_CHECK
- QT_NO_XCODE_MIN_VERSION_CHECK
- QT_NO_APPLE_SDK_MAX_VERSION_CHECK
The warnings can be upgraded into errors by configuring with
-DQT_FORCE_FATAL_APPLE_SDK_AND_XCODE_CHECK=ON
The platform version requirements that qtbase specifies in .cmake.conf
are saved in Qt6ConfigExtras.cmake so that they can be used when
configuring other non-qtbase submodules.
The code is added to the public CMake files, so that in the future we
don't need to move code around if we enable the checks for public
CMake projects as well.
The version extraction helpers were moved out of QtAutoDetectHelpers
into QtPublicAppleHelpers.
Task-number: QTBUG-119490
Change-Id: Ic840e1013aeb607bf23247a9cb43471dde802e9d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
And automatically include and install it in all qt builds.
We will use some of its functions for enforcing apple sdk
requirements when building Qt.
Change-Id: I46383bc857430d35314dfa2ebef9eb342fb63560
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Otherwise we don't have access to the 'debug' and 'debug_and_release'
features to decide whether the install script needs to strip binaries
or not.
Amends 09fdddeb32
Pick-to: 6.6
Fixes: QTBUG-118070
Change-Id: I4f1b8463fa369edd38c1110d1d69e7fa7a45de63
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Tests should only use the LIBRARIES option.
Pick-to: 6.5 6.6
Change-Id: I3c1e4a563448e8f97219c10566cea921a2807abc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
QDBusAbstractAdaptor is expected to be used with a parent.
Add an assertion that will fail if a user is using this
class incorrectly. That's easier to debug than a null
pointer dereference in QDBusAdaptorConnector::polish().
Fixes: QTBUG-18525
Change-Id: I1934475fe277e0cc08435d79f1d453d6576f0b1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A non-aliased drawRect(r.adjusted(0, 0, -1, -1)) no longer does the job
in Qt6: hi-dpi is now enabled automatically, which scales the painter
and leads to horrible (non symmetric) rendering.
I doubt any actual widget style calls into this code (which draws
a focus rect with a plain line) but it's still a useful example
and fallback when writing a widget style.
Pick-to: 6.6
Change-Id: Ib407a7355033258be568b4826fe01c110f02c018
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
The class had operator==() and operator!=() defined as public member
functions, so use QT_CORE_REMOVED_SINCE and removed_api.cpp to get
rid of these methods and replace them with hidden friends.
Extend unit-tests by using the helper functions from QTestPrivate.
Task-number: QTBUG-104111
Change-Id: Ib9ca613005e2f1521dea5e3cd9e2baa0b47fede4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The unit-tests were already ported to the new comparison helper
functions from QTestPrivate.
Task-number: QTBUG-104111
Change-Id: I95fccb33433b3bbf1167545e347a271140727f23
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The unit-tests were already ported to the new comparison helper
functions from QTestPrivate.
Task-number: QTBUG-104111
Change-Id: I23267fd457547b2705e821e7666130f5f9c019d5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Comparison with std::chrono types is also supported due to implicit
QDate constructors, which were made constexpr and noexcept in the
previous patch.
The unit-tests were already ported to the new comparison helper
functions from QTestPrivate.
Task-number: QTBUG-104111
Change-Id: Ib6b1122af9eaf2cb2c9db768150a31cf3bcadcc0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The helper function
RetType compareThreeWay(const T &left, const T &right) noexcept;
is used for C++20-comparison macros. Normally it's the user's
responsibility to provide this function as a hidden friend of the class
which uses the comparison helper macros.
For built-in types we provide the implementation inside the Qt
namespace.
We have to use custom IsIntegralType trait because libstdc++ only
treats __{u}int128_t types as integral when compiling in -std=gnu++XX
mode, and we compile Qt in -std=c++XX mode.
This patch provides the implementations only for compareThreeWay()
overloads, because there is no need to implement comparesEqual() for
built-in types. It would just be equivalent to calling operator==(),
so the user can do it directly.
Task-number: QTBUG-104113
Change-Id: I7b3f395458e1ee4c64f442ad48bbf4fec4c19c52
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The operator<=> is only checked if it is implemented.
Task-number: QTBUG-104113
Change-Id: I89396ca5edea7db9e1f9b0459c277cb4268e1f48
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
These macros should unwrap into a proper set of equality and ordering
operators, depending on the C++ standard being used.
For C++17, all 6 operators (==, !=, <, >, <=, >=) are overloaded, while
for C++20 only the overloads for opeartor==() and operator<=>() are
provided.
The macros are documented as internal for now.
The macros rely on two helper functions:
bool comparesEqual(LeftType lhs, RightType rhs);
ReturnType compareThreeWay(LeftType lhs, RightType rhs);
The comparesEqual() helper function is used to implement operator==()
and operator!=().
The compareThreeWay() helper function is used to implement the four
relational operators in C++17, or operator<=>() in C++20.
ReturnType must be one of Qt::{partial,weak,strong}_ordering.
When possible, the functions should also be declared constexpr and
noexcept.
It's the user's responsibility to provide the functions before
using the macros.
Implement a test case which applies the new macros to the dummy
classes, and uses the new helper function to verify the comparison
results.
The MSVC compiler before version 19.36 has a bug, where it fails
to correctly generate reverse opeerators in C++20 mode. Introduce
a new Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY definition for such
compiler versions, and use it to manually generate reversed
operators when needed.
Task-number: QTBUG-104113
Change-Id: Idc19d55df011fd616ff654f35a964e831b8ab93b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Same as when setting the features, we need to detach (but keep
the engine data) when clearing them.
Change-Id: I3adcadfb24c4abfff9c9e1c4f42ed4af919c71f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The new column is currently unused, added for the benefit of an
imminent change, but adding its value was going to change every data
row, making the new rows with a different value there hard to see amid
the diff.
So add the unused value to the existing data rows and clean them up in
the process:
* Use modern string literals
* Split lines (that need it) in a consistent way
* Give test-cases not-entirely-meaningless names.
Change-Id: I9abdd24b7bb945796878c664d2ed82ca6c409fc1
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The CMake documentation states that the AUTOMOC_MACRO_NAMES property of
a target is initially set to CMAKE_AUTOMOC_MACRO_NAMES, so do not
override it in qt_enable_autogen_tool.
Instead, append the extra macro names not set by the upstream CMake
CMAKE_AUTOMOC_MACRO_NAMES variable.
Add a test for this.
Change-Id: Ib0ef28e7fc9c5f9559150bbe73ffdeac767adc82
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When SSL backends were broken out as plugins, various tests were
suppressed since the code they test is now in a plugin, no longer part
of the network libraries.
The ASN.1 test is, however, fairly self-contained, so just compile it
with the relevant plugin sources (which are likewise self-contained)
and brute-force the paths to line up for the test.
Task-number: QTBUG-46843
Change-Id: I778489e68b7361a7fd55c88d2a35257ad6a58c46
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
While the version option was already there, it had no output attached
to it, and simply generated the whole help text. Make sure that if the
-v/--version option is set, only the tool version is outputted.
Fixes: QTBUG-119511
Pick-to: 6.6
Change-Id: I59ee620333c02eb0a031cd05ac3170216cd034fa
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The width and height of WM_SIZE parameters in LPARAM are unsigned ints,
but were extracted as signed ints with GET_X_LPARAM and GET_Y_LPARAM,
leading to signed integer overflow when using big window sizes.
The width and height are now extracted with LOWORD and HIWORD.
Fixes: QTBUG-119424
Pick-to: 6.6
Change-Id: Ie68716a08a686739b6464ce76319dc659fede336
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
When using the cosmetic stroker (i.e. plain pens with effective line
width of 1), drawing points with fractional coordinates >= 0.5 would
fill the wrong pixel.
This is a long-standing bug where the drawPoints() code in the
cosmetic stroker code was missed during the painting coordinate system
shift for Qt 5.0. Prior to that, coordinates were interpreted as the
upper left corner of a pixel, so rounding fractional coordinates to
the closest integer would be the correct way to determine the pixel to
be filled. From Qt 5 onwards however, coordinates instead designate
the center point of the primitive to be stroked. In order to determine
which pixel is most covered by the unit square centered in the given
coordinates, fractional coordinates must be rounded downwards
(floored).
This fix makes the behavior consistent between the cosmetic and
non-cosmetic stroker, so that drawPoints() with e.g. penwidths 1 and
1.01 in practice fills the same pixels.
Pick-to: 6.6
Fixes: QTBUG-119306
Change-Id: I39cb7ad55229553dda098e6fbc9ee449b1fd9664
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Added breaks in List of Stylable Widgets table.
Changed List of Properties table into sections.
Added list of Qt-specific properties in beg of List of Properties chapter.
Moved snippet comments to different rows.
Task-number: QTBUG-118446
Pick-to: 6.6
Change-Id: I494401058c7982c0a0ada18c8c94429beabba348
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
Since we expect soon to support embedding of Qt from native
Android apps, and allowing native apps to access some Qt java
classes as API to enbale the embedding, it's needed now to
set the visibility to public only to classes that are meant
to be public.
Task-number: QTBUG-115017
Change-Id: Iec73f8d39bf9c5f7d303176b2b345d5928fb46c7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Unregister the display manager listener onPause or onStop
and register again when onResume is called.
Task-number: QTBUG-118077
Change-Id: Ic48defda019fb132ef22a8229c4b549b0414b100
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Since the display manager is mainly created by the Activity delegate
and lives with it, so pass the Actitivy and use it internally,
instead of passing it to every method.
Task-number: QTBUG-118077
Change-Id: I7761490ac8746cc6dad3bd59514a54da18519990
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Starting the native application is not the responsibility of QtLayout
instead it makes more sense to be done under QtActivityDelegate so
move that logic there and avoid keeping its runnable inside the
QtLayout.
Task-number: QTBUG-118077
Change-Id: I4869cb5aa741289ed0e9ccaa1cf2ae42c9dd4791
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
System UI visibility is saved under onSaveInstanceState()
but never restored under onRestoreInstanceState().
Task-number: QTBUG-118077
Change-Id: Ic9956a4aca9e0b9bb5fefa37d7229dd0d52c7344
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
This has been used to notify that the platform integration is
setup and ready, now the name is more descriptive of what it does.
Task-number: QTBUG-118077
Change-Id: I9fab525f07433f9ec8057e2475a3b1e4658f84d9
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Cleanup 'isStarted' and state management logic and move it
to QtNative. Currently, it's spread between QtActivityDelegate and
QtNative where multiple variables are used for overlapping use
cases.
Task-number: QTBUG-118077
Change-Id: I2c98b48be78809c30636bfdf6d6640317470cec6
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Explicitly register QtDBus-specific metatypes before attempting
to generate output. This fixes a bug when types like QDBusObjectPath
are sometimes ignored by this tool. Export QDBusMetaTypeId::init()
for that reason. Add a regression test to tst_qdbuscpp2xml.
Fixes: QTBUG-34550
Change-Id: I16faa79a794d09a26bad45e18730379681a20b50
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
That way we don't need to decode to QString in order to compare to
"Keys". There's no avoiding the conversion to it when inserting in the
map for top-level elements, but use of moc's -M option is extremely
rare.
Ideally, we'd simply ask QCborStreamReader to perform a comparison to a
string of ours, so we didn't have to memcpy from the stream in the first
place. But TinyCBOR has no API for that (it's been pending as
https://github.com/intel/tinycbor/issues/223 for a while).
Change-Id: I8bd6bb457b9c42218247fffd1797607f75b153f4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Without parsing the whole metadata structure into a QCborValue.
QFactoryLoader::indexOf() is only used in the icon engine and
accessibility loaders. QFactoryLoader::keyMap() has more users, but
QFactoryLoader::metaData() is still by far the most used interface.
Task-number: QTBUG-114253
Change-Id: I8bd6bb457b9c42218247fffd179753524fc9b6a5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This doesn't simplify the actual parsing or make it any faster, but does
merge the validation code so we only have it in one place.
Change-Id: I8bd6bb457b9c42218247fffd1797543bec9cfbec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Commit d9766ddc3d (Qt 5.12) replaced the
use of the old binary JSON format with CBOR, which is more compact and
standard, but requires actual parsing instead of just a quick size
verification. For regular, loaded plugins, the metadata is stored in
parsed QCborValue format, but for static plugins, we were re-parsing
each staticplugin's metadata for every single call.
This avoids a full parsing and only parses the CBOR header to find the
IIDs (moc always outputs the IID first).
Fixes: QTBUG-114253
Pick-to: 6.6
Change-Id: I8bd6bb457b9c42218247fffd179750ec6c9e3252
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Use ndk-stack [*] tool provided by the Android NDK to pretty
print crash stacktraces to contain <source-file>:<line-number>
lines for calls, making debugging crashes much easier.
The ndk-stack path can be provided with the new param --ndk-stack,
otherwise, it would be deduced using ANDROID_NDK_ROOT env var.
If the tool is not found or the unstripped libs path cannot be
obtained, the default crash report is printed instead.
[*] https://developer.android.com/ndk/guides/ndk-stack
Task-number: QTQAINFRA-5928
Pick-to: 6.6 6.5
Change-Id: I22c3ba131a44050c8fcbfd176d5ced096761d229
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Currently, under waitToFinish(), we wait for the app to start and if
it doesn't start or starts and exits too quickly for the test runner
to catch it, it fails. The test runner tries to get the pid of the test
after it detects the app has started. However, we don't really need to
fail, the test runner could simply continue the execution and assume
the test was run and finished, and proceed to fetching the test results.
Since, the results fetching don't anyway rely on the pid, the test
runner can let that operation decide whether to fail or not (if not
output is found).
Also, along the way, instead of issuing a different command to get the
pid (i.e. adb shell pidof), we can use the same "adb shell ps" command
that is used to check if the app is running, to obtain the pid.
Fixes: QTQAINFRA-5928
Fixes: QTBUG-88508
Pick-to: 6.6 6.5
Change-Id: Ice945fcb686c4ef21b5f1c143aa22922ae928333
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
For better debugging for test failures, print both logcat and crash
stacktrace (since the start of the current test only), to have an
immediate idea of the reason of the failure or crash if any.
The crash report and the logcat for Android before level 23, is fetched
from the device's time of the app start since those two cases don't
have an option for filtering by pid.
Task-number: QTQAINFRA-5928
Fixes: QTBUG-114898
Pick-to: 6.6 6.5
Change-Id: I7760985032f342da4165cdb7573d4cfe5369ae03
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
To make debugging easier, print a log for each step in the test
output retrieval process instead of one error message that cover
multiple potential error cases.
Task-number: QTQAINFRA-5928
Pick-to: 6.6 6.5
Change-Id: Ia68c15e34cf4b0f8e2b0d351af785bb753807721
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
By parsing QDate and QTime separately it will internally parse the
values as-if-by UTC. This means we avoid the overhead of figuring out
what the local timezone is repeatedly for each certificate.
On Windows, with Schannel, this brings QAsn1Element::toDateTime
from consuming more than 97% of the test time to below 10%.
The test being tst_QSslSocket::systemCaCertificates. It also goes
from taking 1 minute in debug, to 1 second.
As a drive-by: add a (currently) failing test for Feb 29 2000, which
fails because we decode the date as 1900 before adjusting it to 2000.
But there is no 1900-02-29, so it returns an invalid date. As spotted
by Eddy.
Pick-to: 6.6 6.5
Change-Id: Iefa73a01d710129faf6412c4fa8bc2b5d7c98bbb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
In the test, we compare the position of the cursor after making a selection.
The behavior in Windows, QNX and VxWorks is different than usual - they do not jump to the beginning of the selection.
It is configured in the unselectingWithLeftOrRightChangesCursorPosition() function.
Task-number: QTBUG-115777
Change-Id: Ibb721be123bb04aac957f23d468920edcac8fbc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When QWindowSystemInterface::handleKeyEvent() is called under
QtAndroidInput's keyDown() JNI native method callback, it throws
the following warning:
W Gallery : QObject: Cannot create children for a parent that is in a
different thread.
W Gallery : (Parent is QGuiApplication(0x707968a2e0), parent's thread
is QThread(0x70d6477280), current thread is QThread(0x70d18ff790)
when no keyboard QInputDevice has been registered, this behavior is
present at least on Android Emulators.
Task-number: QTBUG-46412
Fixes: QTBUG-106928
Fixes: QTBUG-118421
Change-Id: Iec1c6e3a599e1e553d049df3021653a0d4197e7d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Instead of duplicating file names that need to be include()'ed
in two different places if the files are meant to be used
in both Qt builds and public user projects and then also mention the
name when installing, extract the file names into lists returned by
functions.
Call these functions where needed to iteratively include() the files
as well as install them, without having to remember updating multiple
code locations.
The new functions return the following list of file names:
- upstream cmake modules that need to be included during a Qt build
- public (Qt build and user project) cmake helpers that need to be
included and installed
- private (Qt build only) cmake helpers that need to be included and
installed
- public files that need to be installed, but not included
- private files that need to be installed, but not included
We also generate the list of public files to include in
Qt6Config.cmake.
Task-number: QTBUG-86035
Change-Id: I1e7287f4e1d041c723f144ba9626b34f873c4891
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Make the QtBuildRepoHelpers and QtBuildRepoExamplesHelpers files
that were previously loaded as part of BuildInternals package instead
be loaded when qt_internal_include_all_helpers is called.
Load all the helpers as soon as find_package(QtBuildInternals) is
called rather than when qt_build_repo() is called.
This is a behavior change, but because including the Qt's Helpers
should have no side-effects aside from defining functions,
it should be fine.
This lets us have a unified location where to include Helpers files,
instead of thinking whether it needs to be done in QtBuildInternals or
in QtBuildHelpers or some other place.
Move also some additional inclusions into the same function.
Note that including some upstream CMake files like CMakeFindBinUtils
does have side-effects, but we've been doing it already anyway,
so moving it to the top should not make a difference because any
modifications we would do to the globally assigned variables would
have come later when we actually called our own functions.
Task-number: QTBUG-86035
Change-Id: I33f36f7e8db69d504c34a4d4a094b98f6fa50ee4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
They don't have side-effects, so no need to keep the checks.
Task-number: QTBUG-86035
Change-Id: Ic2c3aee1b19d8b1727936582bfe366c8277d11c2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Previously qt_internal_read_repo_dependencies had to be defined
before QtBuildInternalsExtra.cmake was included because the file
called the function.
Instead of calling the function in QtBuildInternalsExtra.cmake, just
call it later after the Helpers have been loaded. We can do this
because the function is always called unconditionally, so no point in
doing it in the generated file.
This lets us move the function into the QtBuildRepoHelpers.
Amends 98e8180e56
Amends a804ac3d88
Task-number: QTBUG-86035
Change-Id: Idffed8f2eb9d728c779b77b31eba0d24d85752ea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Move most of the code into two new files:
- QtBuildRepoHelpers.cmake
- QtBuildRepoExamplesHelpers.cmake
Task-number: QTBUG-86035
Change-Id: I48c4e7c64f0ffb600118172b8e69b26018f36ffb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Split all code in QtSetup into separate functions and macros, put them
in more appropriate files, and call them in
qt_internal_setup_build_and_global_variables.
A new QtBuildOptionsHelpers.cmake is created which takes care of
computing the default values of user-customizable options that are not
pure configure features, like the cmake build type, whether to build
tests / examples, whether to enable ccache, etc.
The new function calls added in
qt_internal_setup_build_and_global_variables
try to preserve the previous code flow when QtBuild was included
in-between the code that was run in QtSetup.
Macros that have dependencies on various global variables were marked
as such with inline comments for easier navigation and comprehension.
After this change, QtSetup.cmake just includes QtBuild.cmake. We leave
it to exist for easier git blaming, but new code should not be added
to it unless really necessary.
The intent is to merge a variant of this change to 6.6 and 6.5 as
well.
Task-number: QTBUG-86035
Change-Id: I3409c2d3ea8ee19a69104b12ab2692966ba5f9cf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
My motivation to do this:
- it got big and tangled again
- sometimes functions need to be added to QtBuild.cmake rather than
to a separate file because they need to be called before some of the
global variables are set, to determine the value of those global
variables (in my case install paths needed to be modified when
building with xcframework support)
- some of the global variable assignments have dependencies on other
variables already being set and it's hard to keep track where that
happens
Split the contents of the file into smaller functions and macros
and place them into pre-existing files when appropriate, or
into new files. The new files are:
- QtBuildHelpers.cmake
- QtBuildPathsHelpers.cmake
- QtMkspecHelpers.cmake
The idea is to have Helpers file only define functions and never call
them, so it's easy to include the file where needed without being
scared of side effects.
QtBuild.cmake will just include the helpers and call one entry point
function to set up everything that was done by the file before.
QtBuild.cmake is not merged into QtSetup, to make it easier to git
blame (it's hard to blame a removed file).
No new features were added as part of the refactoring.
Some function names were renamed (but not all of them) to include
the qt_internal prefix.
Some lines were reformatted so they don't pass 100 chars limit after
the code was placed into a function / macro.
The Helpers includes were re-sorted.
Some function calls were re-ordered where the order call didn't
matter.
Some of the code in QtAndroidHelpers.cmake was wrapped into a macro
so that including the file does not cause side-effects by default.
I'd like to follow up with similar changes for QtSetup.cmake and
QtBuildInternalsConfig.cmake where possible, because having a few
"entry points" into building a Qt submodule is also confusing,
especially for those that aren't familiar with the build system and
why certain things go into certain places.
The intent is to cherry-pick this also to 6.5 and 6.6.
Amends 44cce1a2ea
Task-number: QTBUG-86035
Change-Id: I02ceff8ceb9b6e9c78bc85d6a42deb02fca3e46b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
We were losing wakeups in cases where wakeUp() was
called during processPostedEvents(), since wait()
was unconditionally resetting m_wakeUpCalled.
Fix this by setting m_wakeUpCalled to false before
processing posted events, and then checking if it's
still false before waiting.
We don't hold the mutex while processing events so that
can still race with wakeUp() calls, but this should
now be harmless since at worst we'll spin and check
for posted events one extra time before waiting.
Pick-to: 6.6 6.5
Fixes: QTBUG-118416
Change-Id: I0183747c4d1f128bb6a46ba9c68f4eeb4d35a138
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
wheel_scroll_lines is no longer used so it should be removed.
Superseded by QPA/WheelScrollLines.
Pick-to: 6.6
Change-Id: I98fa58d5ad32d26ce3b8b8068b244a5a1789ad4f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>