The change fixes the labels to show up correctly in the configure
summary.
It also allows enabling the sanitizer via the feature flags, e.g.
-DFEATURE_sanitize_address=ON.
Finally the qtbase sanitizer option is saved in QtBuildInternalsExtra
so that repos built after qtbase have the same sanitizer options
enabled.
Change-Id: Ic9d9e3ce3c7ebbc244ced2e6d163d1ac8ee06b12
Fixes: QTBUG-84721
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The qt_internal_apply_gc_binaries function should apply both compile
and link flags, not just link flags.
The flags should be applied publically to all consumers of Bootstrap
regardless if the gc_binaries feature is enabled.
The flags should be applied publically to Core only in case if the
feature is enabled (aka for static builds only).
Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac
Fixes: QTBUG-84461
Task-number: QTBUG-83929
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
[ChangeLog][General] The QtOpenglExtensions module has been
discontinued. It provided only convenience functionality for certain
direct OpenGL usage. With the new RHI graphics API abstraction, that
is no longer a primary use case. Applications that still need to
access that API have a number of alternative options, including
QOpenGLExtraFunctions.
Fixes: QTBUG-84085
Change-Id: I272af61c69ebcec207b576d67d08b59623d485ec
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This patch allows tools to be built for the target platform when the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration
time.
To avoid naming conflicts, the target tools are suffixed with "_native".
The qt_get_tool_target_name() function can be used to get the tool name
for both scenarios (cross and non-cross compilation).
Extend pro2cmake to refer to the right target name for tools.
The relevant write_XXX functions have a new target_ref parameter that
will be "${target_name}" for tools and literally the target name for
everything else.
Fixes: QTBUG-81901
Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The ANGLE removal's manual configure.cmake changes are now replaced
by updating the conversion script's special cases instead.
Change-Id: I06317fe0202b25bd9f9524da14e1bb0ccbb30cc1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When writing the qt6_qml_type_registration call, make sure to write
the set(QT_QML_MODULE_INSTALL_QMLTYPES TRUE) statement only if an
explicit path was provided via
QMLTYPES_INSTALL_DIR / QT_QML_MODULE_INSTALL_DIR.
This will remove the QT_QML_MODULE_INSTALL_QMLTYPES property from
many examples and tests in qtdeclarative, thus not installing the
.qmltypes file into the Qt prefix, thus polluting it.
Task-number: QTBUG-84403
Change-Id: I5c64d42915896d14f2591cbb64d73d912dbf7c7d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
so that they can be used with Q_STATIC_ASSERT().
Also constify more another array.
Change-Id: I1e7208127e06abb33af9bdc46712657af5dc98fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The next time qurltlds_p.h is generated, array sizes shall be explicit.
Also added some helpful comments. And updated copyright date.
Change-Id: I2bc9a78bcc2982845fce75a413e2048b0bfd12a0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
For modules that are not yet ported to CMake and that use
QMAKE_USE += libfoo
we need to provide the information about libfoo in the qt_lib_XXX.pri
files.
Also, we now generate qt_ext_XXX.pri files for bundled 3rdparty libs.
Task-number: QTBUG-75666
Change-Id: I9e4b057a197554ecb37c294c0bf09e2a2b3aa053
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QMake variables are always string lists, but some variables are used to
represent single string values. People tend to fill those variables with
multiple values and expect them to be joined by spaces.
Exhibit A: qtdeclarative/tools/qml/qml.pro
QMAKE_TARGET_DESCRIPTION = QML Runtime
QMake supports this for many values. Do the same for Scope.get_string().
Change-Id: I6af22bc1bfed07a4d8eac94d7315051a5bcb7a4d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We should search for the values of function names rather than
the mapping key.
Change-Id: Iedef7fcf4d716ff7f6d277d9626d9dc2dd781401
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
There are (at least) two implementations of the low-level case-folding
algorithm, one of which (for QChar::toLower()) seems to be wrong (it
doesn't deal with special cases which expand to more than one code
point).
The algoithm hidden in QString and entangled with the QString
detaching code makes reusing the code much harder.
At the same time, the dependency of the algorithm on the unicode
tables makes exposing a non-allocating result type in the public API
hard. std::u16string would be an alternative if we can assure that all
implementations use SSO with at least four characters.
So, for the time being, leave this as internal API for use in an
upcoming QStringView::toLower() as well as case-insensitive hashing.
Change-Id: Iabb2611846f6176776aa20e634f44d8464f3305c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When building examples standalone, 'INSTALL_EXAMPLESDIR' may be
undefined.
The converted .pro files now check whether the variable is
set to prevent installation into unexpected locations.
Fixes: QTBUG-81797
Change-Id: I9f97568923c8103011a41d9af7cfe02dd1e40b56
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And create one for QtBase at the same time.
Fixes: QTBUG-83835
Change-Id: Icc6b022165a57bd4e22c23bdb0016522b99a5b80
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
CMake IMPORTED targets should be namespaced so that CMake knows that
the name refers to a target and not a file.
Use the existing WrapXXX naming scheme where applicable.
Fixes: QTBUG-83773
Change-Id: I5b0b722c811200c56c260c69e76940a625228769
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This makes existing calls passing uint or ushort ambiguous, so
fix all the callers. There do not appear to be callers outside
QtBase. In fact, the ...BreakClass() functions appear to be
utterly unused.
Change-Id: I1c2251920beba48d4909650bc1d501375c6a3ecf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Now that the standard gives us proper types for UTF-16 and UTF-32
characters, use them. Will eventually make the code much easier to
read than today, where uint could be an index as well as a char32_t.
It also ensures that the result of e.g. QChar::highSurrogate() can
still be implicitly converted to a QChar now that the
QChar(non-characater-integral-types) ctors are being made explicit.
[ChangeLog][QtCore][QChar] All low-level functions
(e.g. highSurrogate()) now take and return char16_t instead of ushort
and char32_t instead of uint.
Change-Id: I9cd8ebf6fb998fe1075dae96c7c4484a057f0b91
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This feature is Windows-only and must be turned on manually.
For MSVC it sets the MSVC_RUNTIME_LIBRARY target property.
For MinGW it adds the -static linker flag.
Change-Id: I9da3b88d545b34bc34a3a80301b2dd1b5986fa88
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch adds a publicly callable qt6_add_plugin() API to create
plugins. This API is meant to cover cases such as the plugandpaint
example.
This patch also renames qt_add_plugin to qt_internal_add_plugin in order
to avoid clashes with the public API. To avoid breaking the existing
projects, a compatibility wrapper function is enabled by default unless
QT_DISABLE_QT_ADD_PLUGIN_COMPATIBILITY is specified.
Fixes: QTBUG-82961
Change-Id: If5b564a8406c90434f1bdad0b8df76d3e6626b5f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This maps to the CMake variable QT_USE_CCACHE.
Change-Id: I3258027301284d907f6ecde6c65d2c0dde8f0a11
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This maps to the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION.
Change-Id: Id0ce48f176b95c27e74ab80276e89503b1660f79
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This feature was removed in commit 60588e1a.
Change-Id: I061410dfab13a2210474014892d1bc828a5b21cf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Instead of using CMAKE_INSTALL_RPATH to embed an absolute path
to prefix/libdir into all targets, use the more sophisticated aproach
that qmake does.
For certain targets (modules, plugins, tools) use relative rpaths.
Otherwise embed absolute paths (examples, regular binaries).
Installed tests currently have no rpaths.
On certain platforms rpaths are not used (Windows, Android,
iOS / uikit).
Frameworks, app bundles and shallow bundles should also be handled
correctly.
Additional rpaths can be provided via QT_EXTRA_RPATHS variable
(similar to the -R option that configure takes).
Automatic embedding can be disabled either via QT_FEATURE_rpath=OFF
or QT_DISABLE_RPATH=ON.
Note that installed examples are not relocatable at the moment (due
to always having an absolute path rpath), so this is a missing feature
compared to qmake. This is due to missing information on where
examples will be installed, so a relative rpath can not be computed.
By default a Qt installation is relocatable, so there is no need to
pass -DQT_EXTRA_RPATHS=. like Coin used to do with qmake e.g. -R .
Relative rpaths will have the appropriate 'relative base' prefixed
to them (e.g $ORIGIN on linux and @loader_path on darwin platforms).
There is currently no support for other platforms that might have a
different 'relative base' than the ones mentioned above.
Any extra rpaths are saved to BuildInternalsExtra which are re-used
when building other repositories.
configurejson2cmake modified to include correct conditions for the
rpath feature.
It's very likely that we will need a new qt_add_internal_app()
function for gui apps that are to be installed to prefix/bin.
For example for Assistant from qttools. Currently such apps
use qt_add_executable().
The distinction is necessary to make sure that relative rpaths are
embedded into apps, but not executables (which tests are part of).
Amends e835a6853b
Task-number: QTBUG-83497
Change-Id: I3510f63c0a59489741116cc8ec3ef6a0a7704f25
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The QT_OPENGL_ES* macros are leftovers from an earlier,
ad hoc configuration system, which has since been
replaced by QT_CONFIG. To clean things up in Qt 6,
we use the new way instead.
Task-number: QTBUG-83467
Change-Id: I578dc7695bff9d5ee303b22e44f60fee22fe0c28
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Expand $$MODULE_BASE_DIR to ${QT_BUILD_DIR}.
Add library mappings for Hunspell.
Add test mappings for QtVirtualKeyboard regarding 3rdparty Hunspell and
T9Write.
Change-Id: Ief007456d0471cbcf9a03d819291edec5f63680f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is required, so that QHash and QSet can hold more
than 2^32 items on 64 bit platforms.
The actual hashing functions for strings are still 32bit, this will
be changed in a follow-up commit.
Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
If a find_package() in a try_compile project doesn't find a package,
and we then link against a non-existent target, the configuration
failure of the compile test also fails the configuration of the
project.
To avoid that, separate library targets from non-targets, and make sure
to only link against the targets if they exist.
pro2cmake now outputs modified compile test project code which iterates
over targets and non-target libraries, and links against them when
needed.
Change-Id: Ib0f4b5f07af13929c42d01a661df2cabdf9b926b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In Coin when provisioning for Android, we download and configure
the OpenSSL package, but don't actually build it. This means that
find_package(OpenSSL) can find the headers, but not the library,
and thus the package is marked as not found.
Previously the openssl_headers feature used the result of finding
the OpenSSL package, which led to it being disabled in the above
described Android case.
Introduce 2 new find scripts FindWrapOpenSSL and
FindWrapOpenSSLHeaders. FindWrapOpenSSLHeaders wraps FindOpenSSL,
and checks if the headers were found, regardless of the OpenSSL_FOUND
value, which can be used for implementing the openssl_headers feature.
FindWrapOpenSSL uses FindWrapOpenSSLHeaders, and simply wraps the
OpenSSL target if available.
The find scripts also have to set CMAKE_FIND_ROOT_PATH for Android.
Otherwise when someone passes in an OPENSSL_ROOT_DIR, its value will
always be prepended to the Android sysroot, causing the package not
to be found.
Adjust the mapping in helper.py to use the targets created by these
find scripts. This also replaces the openssl/nolink target.
Adjust the projects and tests to use the new target names.
Adjust the compile tests for dtls and oscp to use the
WrapOpenSSLHeaders target, so that the features can be enabled even
if the library is dlopen-ed (like on Android).
Task-number: QTBUG-83371
Change-Id: I738600e5aafef47a57e1db070be40116ca8ab995
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Previously the $$PWD was evaluated within the including .pro file,
which generated incorrect relative paths to source files.
Now we use a horrible hack to evaluate keys ending with SOURCES
and HEADERS. If such is a case, use a map_file transformer which
will use the included scope, thus creating correct relative paths.
Fixes projects in qtdeclarative like src/qmltypregistrar and qmllint.
Checked that it doesn't break projects in qtdeclarative and qtbase.
Change-Id: I21f1e4c638c2cf8d0f67e94e1a583ebc54c175a2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Conflicts:
examples/opengl/doc/src/cube.qdoc
src/corelib/global/qlibraryinfo.cpp
src/corelib/text/qbytearray_p.h
src/corelib/text/qlocale_data_p.h
src/corelib/time/qhijricalendar_data_p.h
src/corelib/time/qjalalicalendar_data_p.h
src/corelib/time/qromancalendar_data_p.h
src/network/ssl/qsslcertificate.h
src/widgets/doc/src/graphicsview.qdoc
src/widgets/widgets/qcombobox.cpp
src/widgets/widgets/qcombobox.h
tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
tests/manual/diaglib/debugproxystyle.cpp
tests/manual/diaglib/qwidgetdump.cpp
tests/manual/diaglib/qwindowdump.cpp
tests/manual/diaglib/textdump.cpp
util/locale_database/cldr2qlocalexml.py
util/locale_database/qlocalexml.py
util/locale_database/qlocalexml2cpp.py
Resolution of util/locale_database/ are based on:
https://codereview.qt-project.org/c/qt/qtbase/+/294250
and src/corelib/{text,time}/*_data_p.h were then regenerated by
running those scripts.
Updated CMakeLists.txt in each of
tests/auto/corelib/serialization/qcborstreamreader/
tests/auto/corelib/serialization/qcborvalue/
tests/auto/gui/kernel/
and generated new ones in each of
tests/auto/gui/kernel/qaddpostroutine/
tests/auto/gui/kernel/qhighdpiscaling/
tests/libfuzzer/corelib/text/qregularexpression/optimize/
tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/
tests/libfuzzer/gui/text/qtextdocument/sethtml/
tests/libfuzzer/gui/text/qtextdocument/setmarkdown/
tests/libfuzzer/gui/text/qtextlayout/beginlayout/
by running util/cmake/pro2cmake.py on their changed .pro files.
Changed target name in
tests/auto/gui/kernel/qaction/qaction.pro
tests/auto/gui/kernel/qaction/qactiongroup.pro
tests/auto/gui/kernel/qshortcut/qshortcut.pro
to ensure unique target names for CMake
Changed tst_QComboBox::currentIndex to not test the
currentIndexChanged(QString), as that one does not exist in Qt 6
anymore.
Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
The previous approach didn't work for prefix builds. While a target
might be excluded from building via EXCLUDE_FROM_ALL property, when
calling make install it would still try to install the target and
thus fail.
It's not possible to modify an install() command in a post-processing
step, so we switch the semantics around.
pro2cmake will now write a
qt_exclude_tool_directories_from_default_target() call before adding
subdirectories. This will set an internal variable with a list
of the given subdirectories, which is checked by qt_add_executable.
If the current source dir matches one of the given subdirectories,
the EXCLUDE_FROM_ALL property is set both for the target and the
qt_install() command.
This should fix the failing Android prefix builds of qttools.
Amends 622894f96e
Change-Id: Ia19323a2ef72a3fb9cb752ad2d4f2742269d11c4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Now that we have the 'shared' feature implemented we can easily port
the 'static' feature.
Change-Id: Ia9b54b68d532d73c3d62d12a86c9e8b83e7909c8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Callers and definition were out of sync.
Change-Id: Icda26887cb64c61c7e373766f25559b0d450d112
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
We don't need the test, we can just check the value of BUILD_WITH_PCH
to know whether the feature is enabled.
Regenerate configure.cmake files.
Change-Id: I5691a22af2913bc398f99825e0c41cf2daf5a587
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Most of them are hand-written.
Change-Id: Ia3d83cdc9e279420c9b4700993b428e10cf8fb22
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Some library entries in configure.json have a test entry.
An example is assimp in qtquick3d.
qmake tries to find the library via the sources section, and then tries
to compile the test found in config.tests/assimp/assimp.pro while
automagically passing it the include and link flags it found for assimp.
We didn't handle that in CMake, and now we kind of do.
configurejson2cmake will now create a corresponding
qt_config_compile_test call where it will pass a list of packages and
libraries to find and link against.
pro2cmake will in turn generate new code for the standalone
config.test project. This code will iterate over packages that need to
be found (like WrapAssimp) and then link against a list of passed-in
targets.
In this way the config.test/assimp/main.cpp file can successfully
use assimp code (due to propagated include headers).
qt_config_compile_test is augmented to take a new PACKAGES argument,
with an example as follows
PACKAGES PACKAGE Foo 6 COMPONENTS Bar
PACKAGE Baz REQUIRED
The arguments will be parsed and passed to the try_compile project,
to call find_package() on them.
We also need to pass the C/C++ standard values to the try_compile
project, as well as other try_compile specific flags, like the
toolchain, as given by qt_get_platform_try_compile_vars().
Change-Id: I4a3f76c75309c70c78e580b80114b33870b2cf79
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Python helpfully uses a sensible locale when stdout is a tty but uses
the system (not the filesystem) default encoding, which may be ascii
and unable to encode some of the data we need to save. So brute force
kludge it to ensure emit.encoding is UTF-8 when writing the output
we'll read as UTF-8 anyway.
(This matches dev's commit 0ef79d94f6
for the reworked version of the script.)
Task-number: QTBUG-79902
Change-Id: I60ddc896a308c06e01fa87e8e18e112faa17d601
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
It was causing all lines after the first, in each calendar's
locale_data[], to be over-indented. This only changes spacing.
Change-Id: Ibfc4986548eecbfdba2902cc18f44a2af669bc6d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
I've taken care of all the others in the course of other changes
already ...
Task-number: QTBUG-81344
Change-Id: I44e40a0d1c9f1e1a540a5f4cd252369fdc9b2698
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Previously, if we found one element with required attributes, we would
search into it and ignore any later elements also with those required
attributes. This meant that, if the first didn't contain the child
elements we were looking for, we'd fail to find what we sought, if it
was in a later matching element (e.g. with some ignored attributes).
We would then go on to look for a match in a later file, where there
might have been a match we should have found in the earlier file.
Check all matches, rather than only the first match in each file. Do
the search in each file "in parallel" to save reparsing the XPath.
This clears the search code of rather hard-to-follow break/else
handling in loops; and currently makes no change to the generated
data.
Change-Id: I86b010e65b9a1fc1b79e5fdd45a5aeff1ed5d5d5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
In particular, this changed the US currency formats for negative
amounts to be parenthesised versions of the positive amount forms,
rather than having a minus sign after the $ sign. Test updated.
[ChangeLog][QtCore][QLocale] Currency formats are now based on CLDR's
accounting formats, where they were previously mostly based (more or
less by accident) on standard formats. In particular, this now means
negative currency formats are specified, where available, where they
(mostly) were not previously.
Task-number: QTBUG-79902
Change-Id: Ie0c07515ece8bd518a74a6956bf97ca85e9894eb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
When doing XPATH searches, child nodes that have distinguished
attributes that were not asked for should be skipped. This is part of
the LDML spec and matters when resolving locale inheritance. Scan the
LDML DTD (previously only scanned for the CLDR version) to find which
attributes of which tags are ignorable - all others are distinguished
- and take the result into account when performing XPATH searches.
The XPath we were using for currency formats wasn't excluding
currencyFormatLength elements with type="short" and patterns specific
to thousands (and larger multiples); this is fixed by taking
distinguished attributes into account. However, the XPATH also wasn't
specifying the always distinguished attribute type="standard" that
was, in practice, used for nearly all locales that weren't (wrongly)
using short-forms for thousands; so type="standard" is now made
explicit, so as to minimize the diff.
This leaves only twenty-one locales with a negative currency formats.
A later commit shall switch to using accounting by default (it falls
back via an alias to standard, in any case), thereby restoring the two
mentioned below that were using it by accident, but the present change
gives the minimal diff here.
Thousands-specific formats replaced with sensible ones:
* zh_Hant_{HK,MO} (Traditional Mandarin, Hong Kong and Macau)
* eo_001 (Esperanto)
* fr_CA (Canadian French)
* ha_* (Hausa, when not written in Arabic)
* es_{GT,MX,US} (Spanish - Guatemala, Mexico, USA)
* sw_KE (Swahili, Kenya)
* yi_001 (Yiddish)
* mfe_MU (Morisyen, Mauritius)
* lag_TZ (Langi, Tanzania)
* mgh_MZ (Makhuwa Meetto, Mozambique)
* wae_CH (Walser, Switzerland)
* kkj_CM (Kako, Cameroon)
* lkt_US (Lakota, USA)
* pa_Arab_PK (Punjabi, in Arabic script, as used in Pakistan; uses
arabext number system, whose currency falls back to latn's, for
which pa_Arab over-rides the thousands-format).
Format changed from an over-ridden type="accounting" to standard (so
these lost a negative-specific form) in:
* en_SI (English, Slovenia)
* es_DO (Spanish, Dominican Republic; same)
For some locales we were picking up over-rides of narrow or short list
formats, or formats for or-lists or unit-lists rather than and-lists,
in place of the standard list format, that these locales don't
over-ride, provided by a parent locale. This changed list formats for:
* en_CA, en_IN (dropped "Oxford" comma before "and")
* qu_* (Quechua; dropped "utaq", presumably meaning "and")
* ur_IN (Urdu, India; was using unit-list formats)
[ChangeLog][QtCore][QLocale] Data used for currency formats in several
locales and list patterns in some locales have changed due to now
parsing the CLDR data more faithfully.
Fixes: QTBUG-81344
Change-Id: I6b95c6c37db92df167153767c1b103becfb0ac98
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
CLDR's currency formats do have number system variation, so take it
into account. (The old xpathlite code clearly intended to do this, but
failed at it due to looking for the wrong component of an XPATH to
fix.) This changes the currency formats in use for
* all Dutch locales (because nl.xml lists a currency format for arab
before the one for latn, and they differ),
* Punjabi, Urdu - specifically pa_Guru_IN, ur_Arab_PK (both like
Dutch, arabext before latn; which is correct for pa_Arab_PK and
ur_Arab_IN),
* Sindi (whose over-ride of latn currency format we were using, where
we should be using arab's format, supplied by root's default),
* Tatar (which specifies a generic currency format, which we were
using, before one specific to latn, which we now use),
* Tongan (same as Dutch),
* Konkani (like Dutch, deva before latn) and
* several North African Arabic locales (whose default number system is
latn, rather than arab, but previously used arab's formats).
Task-number: QTBUG-79902
Change-Id: I18d8ec16bfd3a516d1bcd2f63bc7f7f15179a3f4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Move the code out to a CldrReader class in cldr.py, expand CldrAccess
with facilities that needs, expand ldml.py to include support for more
features, finally making xpathlite.py redundant. This initial commit
aims, though, to be bug-for-bug compatible with xpathlite in its
reading of the CLDR data.
It turns out we've been using draftier data than we were aware of
(which might not be a bad thing). The xpathlite code appeared to check
for draft attributes, but these only appear on leaf nodes and most
data were fetched by finding a parent and then scanning its children
without the draft check; only am/pm data was actually being excluded
based on draft values. (We allowed contributed, for am/pm, in
addition to approved, which is all the xpathlite code allows
otherwise.) There are also some less equivocal bugs; I'll deal with
these in later commits.
Simplified number-system data look-ups; the old get_number_in_system()
was taking care of old LDML versions' placement of the number system
attribute; this is no longer needed. (It was also being used for a
currency value to which it was not appropriate, which is now handled
separately; this is one of the bugs mentioned above.) Ditched a
fall-back to nativeZeroDigit, which no longer exists in CLDR.
Change the command-line to take the root of the CLDR data tree, rather
than its common/main/ sub-directory. Support naming the file to which
to write output, as a second command-line argument, instead of always
writing to stdout (which remains the default) and leaving whoever runs
the script to redirect stdout.
Support (internally for now, while adding TODOs to give main() more
command-line options) separating the stderr output into its more and
less interesting parts; for now, continue producing both, but suppress
the least interesting entirely.
Task-number: QTBUG-81344
Change-Id: Ie611b47403a9452b51feaeeaaa0fbc8f7e84dc71
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
This begins the process of replacing xpathlite.py, adding low-level
DOM-access classes to ldml.py and the CldrAccess class to cldr.py
Moved a format comment from cldr2qtimezone.py's doc-string to the
method of CldrAccess that does the actual reading.
Task-number: QTBUG-81344
Change-Id: I46ae3f402f8207ced6d30a1de5cedaeef47b2bcf
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
This saves repetition of temporary-file manipulation code. In the
process, ensure that we tidy away temporary files on failure.
Moved a comment in qlocale.h to *outside* the re-written portion, to
save having to rewrite it every time. Added blank lines to separate
script data from country data in the generated output. Changed 0s in
one comment to zeros, to match another comment.
Isolated use of sys to the __main__ block.
Isolated use of enumdata to the new LocaleHeaderWriter class.
Modernised all the string-formatting I touched.
Task-number: QTBUG-81344
Change-Id: I5768e45d9a8ea23facc303b3dd8af8b3ccbf7ff2
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Broke out the updating of a source file to a ZoneIdWriter helper
class, which enables tidying away the temporary file if we fail.
Collected up the rest of the script into a main() that's now
called from a __name__ == '__main__' block.
Rationalized the imports.
Eliminated an inefficient lookup function by constructing a suitable
dict() before entering the loop that needed it.
Separated the "data you might need to update" tables from the code
that does the work, to make it easier for those adding support for new
zones to see what they're doing.
Removed the spurious $Revision$ from the output and reworded the
premable of the generated file. (It would seem CLDR no longer uses an
RCS-based version-control system.) Generated output is otherwise
unchanged.
Task-number: QTBUG-81344
Change-Id: I7d9de8357ebcb599d154de9f862e25f7ade00390
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
For now unused; later commits shall put them to use.
Transcriber -- base, takes care of tempfile and renaming.
SourceFileEditor -- handles copying parts before and after a common delimiter.
Task-number: QTBUG-81344
Change-Id: I28cf977d0a08825fbb873fb330da6823b88ad3ed
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
The time-zone script was importing two functions from the locale data
generation script. Move them to a separate module, to which I'll
shortly add some more shared utilities. Cleaned up some imports in the
process.
Combined qlocalexml2cpp's and xpathlit's error classes into a new
Error class in the new module and made it a bit more like a proper
python error class.
Task-number: QTBUG-81344
Change-Id: Idbe0139ba9aaa2f823b8f7216dee1d2539c18b75
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
This new class mirrors the existing QLocaleXmlWriter and places the
two side-by-side in qlocalexml.py, rather than having the writing and
reading in separate places.
Made judicious use of transformed versions of mappings to save
repeated iteration of a mapping's entries to do lookups on fist
entries of pair-values; several (id, name, code) data-sets are
sometimes indexed by id, sometimes by name.
Reworked the default_map, that the complicated compareLocaleKeys()
used in sorting locale keys, to map IDs instead of names; the function
also needed the locale_map so that it could convert IDs to names,
which we can skip by going directly with IDs.
Task-number: QTBUG-81344
Change-Id: Iff6a97f7f0755b56dda70d8a6796ec074c558910
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Delegate the output of XML to a helper class provided by qlocalexml.py
and restructure the driver script so that it can be imported without
running anything. It now has a minimal __name__ == '__main__' block
that calls a main() function. This, for the moment, requires a global
via which it shares the CLDR directory with various other functions;
that shall go away in a later commit.
Task-number: QTBUG-81344
Change-Id: Ica2d3ec09f2d38ba42fd930258cc765283f29a71
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Qt uses the qtNomakeTools() function to mark a directory which will
not be built as part of the default target. This is especially
important when cross-compiling (to iOS for example) because the build
process might fail.
The condition for not building these "GUI tool sub-directory projects"
is the absence of the "tools" value in qmake's QT_BUILD_PARTS
variable.
Introduce a QT_NO_MAKE_TOOLS CMake variable. If the value is true,
it's equivalent to "tools" not being present in QT_BUILD_PARTS.
Introduce qt_exclude_tool_directories_from_default_target().
It's the qmake counter part to qtNomakeTools().
Teach pro2cmake to generate it where appropriate.
Change-Id: If2e5958d91847ab139af0e452608510286e73fa0
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Like libs, tools, examples, tests. Built by default means
they are part of the default make / ninja target.
Change-Id: I304e5724fc5dbd39626e9d589a6e1e92a4dd7882
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QT_STATIC must be defined for static builds to have the right
import/export symbol macros defined. Originally, this macro is wrapped
in a condition. That's why we extend qt_feature_definition to be able
to write a prerequisite to qconfig.h.
Change-Id: I610e60acc7f5bdc031eff6d53a76e0b229a5c8c2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is needed for qmake mixing.
Change-Id: I368169606606a8de4dc8f2db5b98660a0a2fa349
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
It's not used in tools at all and fits a lot better in global.
Also fix the qsimd_x86* files to have a proper copyright
header.
Change-Id: Id3d8e7cfcd7769a1ca9f3d8cf6d357a31a99ba40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This patch silences the exception about missing v1 api entry for the
qt_add_3rdparty_library() function.
Change-Id: I74a473ed1c063b13f0a9ca64dcb568b8f8b27235
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Without this patch JPEG support is always disabled, even though we can
build it from 3rdparty sources.
Change-Id: I9e619f0ca8ec3ca3e7c58981bb6af9b33426a029
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We can ignore the tests for those features and directly ask CMake
whether the compiler supports the respective language version.
Change-Id: I31cd35493443fea0c6d0b0a5e641768c3bcbe736
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Do not process selfcover.pri in the conversion as the output requires a
lot of special case fixs ups.
Change-Id: Iebee484db887973369b5604344a6d486f4bea20b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
I kept getting
Ignoring pytest: markers 'python_version >= "3.7"' don't match your environment
when using the pip command, but this alternative worked.
Change-Id: Ibfc7f36de04153d2247f8f62bd129b0c0c723bf2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If a file is present in a QML_FILES variable inside a qmake .pro
file, but is not listed in the static qmldir file, mark the file
so no qmldir entry created for it.
Change-Id: I3ec77b6eedf70ea9124bf7f447ee3477204bc4f7
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Don't exclude it, because we use it in qtimageformats.
Change-Id: I0004830580dd9711cf7a5bd934ecd5a7f9036800
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
This is a follow-up to commit ebb0212133.
The day name data appeared twice in the XML files.
Skip the second copy, saving 8.8% of the intermediate file-size.
This makes no change to generated QLocale data.
Change-Id: Ic2cc543a2a85cbb1d2d47ebac7df4fa9ad6ee0a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Include WordBreakTest.html, since a test uses sample strings from it,
albeit without actually reading the file.
Had to comment out more of the new tests, as at Revision 24, pending
an update to harfbuzz and the text boundary detection code.
Task-number: QTBUG-79631
Task-number: QTBUG-79418
Task-number: QTBUG-82747
Change-Id: I0082294b09d67ffdc6a9b5c15acf77ad3b86f65f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Replace ${QT_SOURCE_TREE} with top level project directory when
encountered in include statements.
This is required to parse tests/auto/testlib/selftests/test/test.pro.
Change-Id: I80f31142cf5a35441d1424c38e21bb097e44cd0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Matches the LIBS_SUFFIX define we use in Android conditions
and replaces it with a sane amount of escaped characters.
Change-Id: I7d870f992c70b105dd80b6fa94f87d3fa5644006
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This prevents Coin from trying to automatically enable the framework
feature when no configuration is specified on the command line.
By default if no configuration is specified, and there's a .git
subfolder, "Debug" will be the chosen config, and that would conflict
with the framework feature, which would cause configuration to fail.
Change-Id: Ia9db3e8178794737692307b4662a2e77cc574ccd
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Teaches configurejson2cmake about summaries / reports, so things
like enabled features, configure sections, notes, etc.
Add relevant CMake API for adding summary sections and entries,
as well as configure reports. The commands record the passed data,
and the data is later evaluated when the summary needs to be printed.
This is needed, to ensure that all features are evaluated by the
time the summary is printed.
Some report and summary entries are not generated if they mention a
feature that is explicitly exclduded by configurejson2cmake's feature
mapping dictionary. This is to prevent CMake from failing at configure
time when trying to evaluate an unknown feature. We should re-enable
these in the future.
A few custom report types are skipped by configurejson2cmake (like
values of qmake CONFIG or buildParts).
These will have to be addressed a case-by-case basis if still needed.
Change-Id: I95d74ce34734d347681905f15a781f64b5bd5edc
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
For this, we have to uninline the separate_debug_info configure test,
because supporting the conversion of this in configurejson2cmake is not
worth the hassle.
Separate debug information can be turned on for a target by calling the
function qt_enable_separate_debug_info. For Qt's shared libraries and
tools separate debug information is generated if the
'separate_debug_info' feature is manually turned on.
Change-Id: Ic2ffc15efef3794dc0aa42f3d853ef6d651a751c
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For the moment, in feature conditions that use STREQUAL, the lhs must be
a variable.
Change-Id: I56fe24baeb8067662ea81984fd48383da4c5b67b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch updates configurejson2cmake.py to generate compile tests for
library entries. The test also support the inherit keyword, which is
currently limited to one level of inheritance.
LibraryMapping has been extended with a test_library_overwrite as a
means to overwrite the mapped library during a compile test. Certain
tests such as openssl_headers form src/network are mapped with *_nolink
libraries which do not exist when the test is run. Failing to do so will
cause the test to run as it is skipped when the library target isn't
found.
To avoid redundant checks, the library tests need to be opt in by
setting run_library_test to True on an instance of LibraryMapping.
Change-Id: I607b24eda389fa67afad301c616e31bb7ab38d20
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If there's no test dir set, use "config.tests" as default value, and
perform the check for the existence of CMakeLists.txt in
configurejson2cmake, not the configure.cmake file.
Change-Id: I8d3be8f2b68767c7592665c374022353c2dc6c57
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Set the default value of the "test" entry to the test's name like the
qmake-based configure does.
Change-Id: Ic1027c54c6312c47dca241dd7e3dc65b3e35d36f
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This feature is read-only and is ON if CMAKE_BUILD_TYPE is RelWithDebInfo
or if that value is in CMAKE_CONFIGURATION_TYPES.
It mainly exists for the qmake support.
Change-Id: I25cb57e832dcfcab100834a104b1a3d34f01086b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This feature is read-only. It's controlled by the multi-config feature
of CMake. It mainly exists for the qmake support.
Change-Id: I322459598fe92568eda4d42319ded444537e95d4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This feature is read-only and supposed to be set by BUILD_SHARED_LIBS.
It mainly exists for the qmake support.
Change-Id: I722b0de53211d0aab1924e45a77120c890f31f50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This feature is read-only and supposed to be set by variables like
CMAKE_BUILD_TYPE. It mainly exists for the qmake support.
Change-Id: Ic7e32cbda0f3c2d92dd446b07a3bf1a8d85ec3b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The non-system harfbuzz feature doesn't actually have a condition
in the json file.
Change-Id: I4b74915f28da97d6ef8f89690e91306d243913ee
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
And in order to do this we must teach qt_config_compile_test a
COMPILE_OPTIONS argument.
Change-Id: I66fa45142b544e3a2fc599af1c1a4c69b442b318
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It implements interaction with the QLocaleXML file format type, so
rename it to match.
Task-number: QTBUG-81344
Change-Id: I46302d4ac1038cdfc5929e73b554b6d793814c56
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
All other members had camelCase names, but the endonyms had
prefix_endonym names, requiring munging where they were emitted to
XML. So just do that munging upstream in the attribute name of the
Locale objects. Makes no change to the data output by the scripts, not
even to the intermediate QLocaleXML file.
Task-number: QTBUG-81344
Change-Id: I01c15a822216281dc669b3e7ebda096d18b04f9b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.
Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It only told me about two packages to install, so I got an error after
I'd installed them and ran it, because I hadn't installed the
rest. Save the next person an extra round-trip.
Change-Id: I8b544fc2637b86656ec2adddce8e95e6e9e1daf5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
As reduce-relocations implies bsymbolic_functions, we also add the
-Bsymbolic-functions linker flag.
Also, handle the .dynlist files that are passed to the linker by
bsymbolic_functions.prf in the qmake build.
Change-Id: I535c33fba888596d2f8975b16864bbe9f0a7caa4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
A few things are needed to accomplish that:
- the python scripts do not ignore certain system_foo features anymore
(it is a hardcoded list for now just to be safe)
- configurejson2cmake now outputs
qt_find_package(WrapSystemFoo) calls for bundled libraries
(see below)
- the harfbuzz .pro file is modified to accommodate pro2cmake
not being able to correctly parse some conditional scopes
- the freetype .pro file is modified to make sure linking of the
library succeeds without duplicate symbol errors, which qmake
doesn't encounter due to magical exclusion of cpp files that are
included in other cpp files (presumably for include moc_foo.cpp
support)
- feature evaluation for Core, Gui, Network now happens in the
qtbase/src directory, so that bundled libraries can be conditionally
built
- for each bundled library there are now two FindWrap scripts:
- FindWrapSystemFoo which finds an installed library in the system
- FindWrapFoo which either uses the system installed library or
the built bundled one depending on a condition
- projects that intend to use bundled libraries need to link against
WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets
(this is handled by pro2cmake).
Unfortunately manually added qt_find_package(WrapFoo) calls might
still be needed as is the case for WrapFreetype and others.
- a new cmake/QtFindWrapHelper.cmake file is added that provides
a macro to simplify creation of WrapFoo targets that link against
a bundled or system library. The implementation is fairly ugly
due to CMake macro constraints, but it was deemed better than
copy-pasting a bunch of almost identical code across all
FindWrapFoo.cmake files.
- a qtzlib header-only module is now created when using bundled
zlib, to provide public syncqt created headers for consumers
that need them. These are projects that have
'QT_PRIVATE += zlib-private' in their .pro files
(e.g. qtimageformats, qtlocation, qt3d, etc.)
This is unfortunately needed due to QtNetwork using zlib
types in its private C++ API.
The change includes support for building the following bundled
libraries:
- zlib
- libpng
- libjpeg
- Freetype
- Harfbuzz-ng
- PCRE2
The following 3rd party libraries are still using an old
implementation within the CMake build system, and should be migrated
to the new one in the near future:
- double-conversion
- Old harfbuzz
The are a few libraries that are not yet ported:
- system-sqlite
- systemxcb
- maybe others
Among other things, this change allows building qtbase on Windows
without requiring vcpkg.
Task-number: QTBUG-82167
Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
This is a prerequisite for building the bundled 3rd party libraries.
Because the feature evaluation will be moved into src/CMakeLists.txt,
some of the X11 packages were found in the src dir, and then a second
time inside the x11-related projects.
These qt_find_package calls in the x11 related projects tried to
promote the imported targets to global, which failed, because they were
created in a different directory scope.
To avoid this, the special case qt_find_package calls are removed from
the nested projects.
Also, fix the mapping of some of the x11 libraries to be correct
- xkbcommon_x11 was incorrectly mapped to XKB::XKB instead of the
xkb common x11 library
- xlib was mapped to xcb, whereas X11 is the correct CMake target
Change-Id: I30781b2ecbdd478c98419b14baa0492037e49c61
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In case of .qmake.conf not existing, this would result in an infinite loop.
Change-Id: I577aaed7a502efb7b01dc6b199dcf464358bf5a9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And move the actual implementation from corelib/io to network/kernel
sub-module.
Fixes: QTBUG-80308
Change-Id: I554b05bae3552c68e1e1a405c169366ee19120b2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Same pattern as QtQuickWidgets. Gets rid of QtOpenGL's dependency on QtWidgets.
Task-number: QTBUG-74409
Change-Id: I4f9b55c23e25a1e0519734037b768a16e870c7d2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Extract the character in its proper unicode form and encode it in a
new single_character_data table of locale data. Record each entry as
the range within that table that encodes it. Also added an assertion
in the generator script to check that the digits CLDR gives us are a
contiguous sequence in increasing order, as has been assumed by the
C++ code for some time. Lots of number-formatting code now has to take
account of how wide the digits are.
This leaves nowhere for updateSystemPrivate() to record values read
from sys_locale->query(), so we must always consult that function when
accessing these members of the systemData() object. Various internal
users of these single-character fields need the system-or-CLDR value
rather than the raw CLDR value, so move QLocalePrivate's methods to
supply them down to QLocaleData and ensure they check for system
values, where appropriate first.
This allows us to finally support the Chakma language and script, for
whose number system UTF-16 needs surrogate pairs.
Costs 10.8 kB in added data, much of it due to adding two new locales
that need surrogates to represent digits.
[ChangeLog][QtCore][QLocale] Various QLocale methods that returned
single QChar values now return QString values to accommodate those
locales which need a surrogate pair to represent the (single
character) return value.
Fixes: QTBUG-69324
Fixes: QTBUG-81053
Change-Id: I481722d6f5ee266164f09031679a851dfa6e7839
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Conflicts:
tests/manual/rhi/hellominimalcrossgfxtriangle/CMakeLists.txt
Hopefully final merge from wip/cmake, and then all cmake changes
should target dev directly.
Change-Id: I29b04c9b0284e97334877c77a32ffdf887dbf95b
Conflicts:
examples/widgets/graphicsview/boxes/scene.h
src/corelib/Qt5CoreMacros.cmake
src/corelib/Qt6CoreMacros.cmake
src/network/ssl/qsslsocket.cpp
src/network/ssl/qsslsocket.h
src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
src/testlib/CMakeLists.txt
src/testlib/.prev_CMakeLists.txt
tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
Disabled building manual tests with CMake for now, because qmake
doesn't do it, and it confuses people.
Done-With: Alexandru Croitor <alexandru.croitor@qt.io>
Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
Add qt_add_3rdparty_library() function as a replacement for qmake's
qt_helper_lib feature.
All 3rdparty libraries will be available under the Qt:: alias when built
through this method so that they can properly register as dependencies
of a Qt module.
This patch also adds Qt3rdPartyLibraryConfig.cmake.in to export the
CMake configuration for static builds and shared libraries.
Change-Id: I52bf3a95ca22fccd9ab54343468847bb1b570c28
Fixes: QTBUG-81969
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Fixes generating some paths with the backslash in the beginning
Change-Id: Ic7705d61f9362d3b854b2eb95f95a8951beca72d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
If a module project (Quick) contains QT += core-private, the
qmake semantics translated to CMake would mean the following:
target_link_libraries(Quick PUBLIC Core)
target_link_libraries(Quick PRIVATE CorePrivate)
target_link_libraries(QuickPrivate INTERFACE CorePrivate)
Whereas a QT_PRIVATE += core-private only means
target_link_libraries(Quick PRIVATE CorePrivate)
without adding any public dependencies to QuickPrivate.
To achieve that, we need a few modifications to both pro2cmake and
QtBuild.cmake
- pro2cmake doesn't automagically add public and private dependencies
to targets when encountering a private module assigned to QT.
Instead it generates the logic described above by passing correct
LIBRARIES, PUBLIC_LIBRARIES, and PRIVATE_MODULE_INTERFACE values.
- pro2cmake doesn't do any dependency magic for non-module targets
anymore, like executables, plugins, internal_modules. This means
that QT assignments are now regular public dependencies.
- qt_add_module and qt_extend_target now accept a new
PRIVATE_MODULE_INTERFACE option.
- qt_extend_target does not automagically make private modules be
public dependencies on other private modules.
- qt_extend_target correctly assigns PRIVATE_MODULE_INTERFACE values
to Private module only. For other target types, it's a no-op.
The change requires regeneration of all projects.
When we fix pro2cmake and QtBuild.cmake to properly handle
internal_modules (create only Private modules without creating
a non-Private counter part), we will need another project regeneration
to correctly assign dependencies.
Change-Id: I4c21f26b3ef3b2a4ed208b58bccb65a5b7312f81
Task-number: QTBUG-81780
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This pulls the CMake port, which not only adds CMake files but also
modifies existing code. A brief summary of "seemingly unrelated" changes:
* configure.json was re-formatted to not use multi-line strings. That
is an extension of the Qt JSON parser but not JSON compliant, which
is needed for the configure.json-to-cmake conversion script (python).
* Some moc inclusions were added due to CMake's slightly different way
of handling moc. With the changes the files build with qmake and cmake.
* Since CMake just grep's for the Q_OBJECT macro to determine whether to
call moc (instead of doing pre-processing like qmake), the existing use
of "Q_OBJECT" in our documentation was changed to \Q_OBJECT, which cmake
doesn't see and which is now a qdoc macro.
* QTestLib's qFindTestData was extended to also search in the source
directory known at build time.
What this change also brings is a new way of building modules in Coin by using
YAML configuration files that describe the steps of building and testing in Coin
specific terms. The platform configuration files in qt5 are instructed to use the
old Coin built-in way of testing ("UseLegacyInstructions" feature) but for any
configurations that do not have this, these yaml files in the coin/ sub-directory
are used and shared across repositories.
Change-Id: I1d832c3400e8d6945ad787024ba60e7440225c08
On macOS it's possible to configure the system locale to not do digit
grouping (separating "thousands", in most western locales); it then
returns an empty string when asked for the grouping character, which
QLocale's system-configuration then ignored, falling back on using the
base UI locale's grouping separator. This could lead to the same
separator being used for decimal and grouping, which should never
happen, least of all when configured to not group at all.
In order to notice when this happens, query() must take care to return
an empty QString (as a QVariant, which is then non-null) when it *has*
a value for the locale property, and that value is empty, as opposed
to a null QVariant when it doesn't find a configured value. The caller
can then distinguish the two cases.
Furthermore, the group and decimal separators need to be distinct, so
we need to take care to avoid cases where the system overrides one
with what the CLDR has given for the other and doesn't over-ride that
other.
Only presently implemented for macOS and MS-Win, since the (other)
Unix implementation of the system locale returns single QChar values
for the numeric tokens - see QTBUG-69324, QTBUG-81053.
Fixes: QTBUG-80459
Change-Id: Ic3fbb0fb86e974604a60781378b09abc13bab15d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This enables us to make the sizes quint8 and benefit from the
resulting packing, making the locale data smaller. The sizes for long
month-name lists (which concatenate twelve names with semicolon as
separator) can overflow an 8-bit member, so use quint16 where needed.
Re-ordered the data in QLocaleData and QCalendarLocale. Now all
long-short(-narrow) families arise in that order; and any standalone
is grouped with the one of the same length. (This cost 20 bytes in the
date-format table, which optimises out more duplication if short is
before long, but the saving in the (smaller) time-format table more
than make up for it; and 20 bytes isn't worth the confusion that being
inconsistent in ordering might cause.)
At the same time, drop trailing semicolons from list entries (which
join various names with semicolon) as they're not needed: we know
where the end of the list is, because we know the size of the string
that results from concatenation. The code that parses such lists can
even correctly handle empty entries at the end.
Saves 26 kB of data in the compiled binaries.
Task-number: QTBUG-81053
Change-Id: If6ccc96a6910828817aa605d10fd814f567ae1e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Some entries in tables were sub-strings (e.g. prefixes) of others.
Since we store start-index and length (with no need for terminators),
any entry that appears as a sub-string of an earlier entry can be
recorded without making a separate copy of its content, just by
recording where it appeared as a sub-string of an earlier entry.
(Sadly this doesn't apply to month- or day-names and their
short-forms: for those, we store ';'-joined lists. Thus, although
each short-form is a prefix of its long-form, the short-form is stored
in a list with other short-forms; and this is not a prefix of the list
of matching long-forms.)
The savings are modest (780 bytes at present), but cost us nothing
except when running the python script that generates the data files
(it takes a little longer now), which usually only happens at a CLDR
update.
Change-Id: I05bdaa9283365707bac0190ae983b31f074dd6ed
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Split a long line.
Use pythonic chained comparison to save some repetition.
Comment on a field not currently in actual use.
Say "zeros" rather than "0s" in one comment to match another.
Added a .h suffix to the main locale data tempfile to match the naming
of the tempfiles used for calendar data.
Simplify generation of the blank line between Language and Script; and
include a matching blank between Script and Country.
This adds one blank line to qlocale.h
Removed a stray space that misaligned locale data lines.
This produces a space-only change in the generated *_data_p.h files.
Change-Id: I974a9e8923c3dfd2178855d2cf1d6a5074e130b3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We have long (since 4.5.1) coerced it to lower-case, for no readily
apparent, much less documented, reason. CLDR says most locales use an
upper-case E for this - let's actually use what CLDR says we should
use.
The code that matches the exponent separator was doing so
case-insensitively in any case; that needed adaptation now that the
separator's case isn't pre-determined; and, in any case, should have
been done using case-folding rather than upper-casing. In the process,
removed some spurious checks for "'e' or 'E'" in the result, since the
exponent separator is always represented by 'e' (and an 'e' might also
be present for the separate reason of its use as a beyond-decimal
digit representing fourteen).
[ChangeLog][QtCore][QLocale] QLocale::exponential() now preserves the
case of the CLDR source, where previously it was lower-cased.
Change-Id: Ic9ac02136cff79cb9f136d72141b5dbf54d9e0a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is needed for qtdeclarative examples, otherwise CMake configuration
fails due to missing QML import version info.
Change-Id: Iedde7b6a9e2d5ac7f6d81969ac7d6d874361c02e
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Python helpfully uses a sensible locale when stdout is a tty but uses
the system (not the filesystem) default encoding, which may be ascii
and unable to encode some of the data we need to save. So brute force
kludge it to ensure sys.stdout.encoding is UTF-8 when writing the
output we'll read as UTF-8 anyway.
Task-number: QTBUG-79902
Change-Id: I218dc0ec4c71a6b1b7181db55b018266d803bc58
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Do not return when no qmldir file is present and no dynamic qmldir
information is set.
Change-Id: I04e458f69e4e4a6ec9b1e7ca7ba0b0f7520996f7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In Qt 5, qmake generates CMake Config files which expose the plugins
as imported libraries. The name of these libraries are derived from
the plugin class name. So QCocoaIntegrationPlugin, and not qcocoa.
To keep compatibility between Qt5 and Qt6 CMake target names,
the pro2cmake script should generate plugin target names based on the
plugin class names.
To avoid passing the same name in qt_add_plugin (target and CLASS_NAME),
derive the class name from the target if the class name is
not explicitly specified.
Also add a new OUTPUT_NAME parameter which is used to change the
final file name of the plugin, so that it's compatible with Qt5.
For example to generate a qcocoa.dylib file, instead of
QCocoaIntegrationPlugin.dylib file.
The same OUTPUT_NAME value will be used for generation of plugin .prl
files for qmake consumption.
Change-Id: I4d53e680d7beb62befecd359cdf6bba60a34ff0d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This can happen in unit tests where a test has TARGET set to "../name",
which requires the target to placed in the parent binary directory.
It is possible to run into a second assignment for OUTPUT_DIRECTORY via
the DESTDIR property (e.g: qdbushmarshall test) which can then result in
two OUTPUT_DIRECTORY values.
However, the first one needs to take precedence or the tests won't
execute properly.
Change-Id: Ib263843fa86c3dd68d92a0989b95f2890335c92d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Automatically insert OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../
for each tests that has a target name which starts with ../. To do so we
added the TARGET_ORIGINAL property which does not remove the ../ from
the target name.
Change-Id: I55ba1385aa160610a0ff80ed56ff37a80c3590fa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The previous implementation was *extremely* expensive. It
relied on loading a binary JSON file from resources (which
involved decompressing it), then extracting information out of
it to build a gradient. Already-loaded gradients were kept in
a local cache, which had to be mutex protected.
Instead, this patch extends the gradient generator to build
static arrays filled with the web gradient data, sitting in
.rodata.
These arrays are used when building QGradient objects with a
web gradient. No explicit mutex protection is necessary, since
accesses will just read from the arrays.
As benefits, this patch removes:
* the binary json representation from QtGui's resources (~4KB
compressed, ~50KB uncompressed)
* the overhead of reading from the JSON for each used web
gradient;
* the startup costs of registering the webgradients in the
resources;
* all the overhead of mutex locking when building such
gradients;
* all the runtime memory allocations to load, parse and cache
the web gradients (including the memory + CPU spike on first
load due to the uncompression of the JSON data, as well as a
couple of deep copies).
Change-Id: If5c3d704430df76ce8faf55ee75ebd4639ba09c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This patch adds a new bootstrap tool which will read CMake's
AutoGenInfo.json and ParseCache.txt to determine what the current
list of json files is that needs to be passed to moc --collect-json
option.
Right now this is enabled for qt_add_module() with the option
GENERATE_METATYPES. pro2cmake has also been updated to detect qmake's
CONFIG += metatypes and to generate the above option for modules.
The implementation lives in Qt6CoreMacros so it can eventually be used
in the public facing apis.
The generated meta types file is saved under the target property
QT_MODULE_META_TYPES_FILE.
Change-Id: I03709c662be81dd0912d0068c23ee2507bfe4383
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Before we only exported features that had outputType PUBLIC or PRIVATE
on the various "QT_ENABLED_PUBLIC_FEATURES" target properties.
Now we also export features that have output type privateConfig,
publicConfig and publicQtConfig.
The new properties names are:
- QT_QMAKE_PUBLIC_CONFIG for outputType == publicConfig
- QT_QMAKE_PRIVATE_CONFIG for outputType == privateConfig
- QT_QMAKE_PUBLIC_QT_CONFIG for outputType == publicQtConfig
These need to be exported for 2 reasons:
- other modules that need to check the config values
- in preparation for generating proper qmake .prl and .pri
information for each module
Note that the config values are now considered actual features
when doing condition evaluation. So if there exists a feature "ssse3"
with outputType privateConfig, its enabled state can be checked via
QT_FEATURE_ssse3 in consuming modules (but not in the declaring
module).
These config values are also placed in the respective
QT_ENABLED_PUBLIC_FEATURES, QT_ENABLED_PRIVATE_FEATURES properties
when exporting a target, so the properties will now contain both
features and config values.
In order to make this work, feature name normalization has to happen
at CMake time, rather than done by the python script.
This means that features like "developer-build" need to retain the
dash in the qt_feature(), qt_feature_definition() and
qt_feature_config() calls, rather than generating "developer_build"
as the script did before.
The normalization is done at CMake time. Feature conditions,
CMake code, and -DFEATURE_foo=bar options passed on the command line
should still use the underscore version, but the original name is used
for the QT_QMAKE_PUBLIC_CONFIG properties.
Note that "c++11" like features are normalized to "cxx11".
Implementation wise, the configurejson2cmake script is adjusted to
parse these new output types.
Also QtBuild and QtFeature are adjusted to save the config values
in properties, and re-export them from GlobalConfig to Core.
Task-number: QTBUG-75666
Task-number: QTBUG-78178
Change-Id: Ibd4b152e372bdf2d09ed117644f2f2ac53ec5e75
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Tested locally with the following configurations:
- iOS device builds (arm64)
- iOS simulator builds (x86_64)
- iOS simulator_and_device builds (fat arm64 and x86_64 archives)
All iOS builds currently require a custom vcpkg fork which contains
fixes for building the required 3rd party libraries.
qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2
have also been tested to build successfully.
simulator_and_device builds are also supported, but require an umerged
patch in upstream CMake as well as further patches to vcpkg.
Task-number: QTBUG-75576
Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Put blank lines before the final Num*Classes entries in enums, to set
them off visibly from the "real" members. Moved some oddly placed
commas to the ends of preceding lines, so that later additions can
just add lines (with comma on end) without having to modify the
preceding line while doing so.
Change-Id: I5188dc25af9e4c17a1882fd9dab070e88013060b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also remove two stray commas pointed out in code-review and some
others noticed on checking for similar.
This amends commit c3eb521a0f.
Change-Id: If20c5146b740defe8d25ff61d399031b5c66ded1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Apparently we didn't have a wrap find module for it before. Add one,
and add special support to handle a Gentoo broken Config file which is
exported by an autotools build of harbuzz.
Change-Id: I83cbeb817caf2610104c16713d4eac6ab6f8c63b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
There is a patch in progress to add mappings for Qt3D, so reuse the old
broken Qt3D mappings, delete the duplicates.
QtOpenGLExtensions is needed, so this patch includes it.
Change-Id: I27896ee88b9e6873c8cd52d86afc330e309e1e14
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Handle conversions for QT_NO_CURSOR, QT_NO_TRANSLATION and
qtConfig(opengles.).
Change-Id: Idd930f77e78f235b7997a5083ac7faf630ed9801
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The script can now generate both old style CMake API calls
(add_qt_module), as well as new style (qt_add_module).
The first case is considered api version 1, and the second case
is version 2.
You can force which api version to use for generation using
the --api-version command line argument.
This is useful when you want to regenerate an old project
(one that hasn't switched to new style), to keep the diffs
easier to read.
When no parameter is specified, the script will auto-detect
which api version is used in the existing CMakeLists.txt file
(if it exists), and keep using that, until someone force regenerates
the project with a new api version.
Change-Id: I41e4e6ed5db94ef7220c09b46fc5f12e6613e5d2
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Otherwise in a condition with multiple comparisons, the regexp would
match too many characters, and not extract the correct variable
name. And to be extra safe, match until a comma is encountered.
Change-Id: I29d8344287efca5c5b232006f6bbdf39e6e4ee67
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This patch adds add_qt_manual_test() which is a simple wrapper around
add_qt_executable() which does not build under ${CMAKE_BUILD_DIR}/bin
or install the targets.
This could potentially be used later to tag manual tests.
Change-Id: Ic4e0a1d133009f5a858b9394347a0996cf42683f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Instead of processing included_children operations either before or
after the parent scope, collect all operations within that scope and
its included children scopes, and order them based on line number
information.
This requires propagating line numbers for each operation as well as
line numbers for each include() statement, all the way from the
parser grammar to the operator evaluation routines.
This should improve operation handling for included_children
(via include()), but not for regular children (introduced by ifs or
elses), aka this doesn't solve the whole imperative vs declarative
dilemma.
Sample projects where the improvement should be seen:
tests/auto/gui/kernel/qguiapplication and
src/plugins/sqldrivers/sqlite.
This amends f745ef0f67
Change-Id: I40b8302ba6aa09b6b9986ea60eac87de8676b469
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Pass either --skip-subdirs-project to pro2cmake or
--skip-subdirs-projects to run_pro2cmake.
Change-Id: Ic444858f6fc6deb3c893782c0770993aa39d5579
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The regular expression used to eat the character that comes after
the x86 token, which was incorrect when matching x86SimdAlways.
Fix the regular expression to use a lookahead with a negative
character class of word characters.
Change-Id: I9ed8f9a490369bf5704b752f8bba3b7118a2cd5b
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
A lot of project files include files like qtsqldrivers-config.pri
which do not exist when running pro2cmake. It should be safe to hide
this error messages when converting projects.
Change-Id: I4205010e537f67f9b276b4cb94ec30f847c43c68
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Don't needlessly show a bunch of special case debug messages
unless debugging is enabled.
There used to be a barrage of scary message when using
run_pro2cmake.
Change-Id: I49ab3522e11844a99653034b5f15a634a368d227
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously repo/tests/CMakeLists.txt was a standalone project on which
CMake could be called. This was useful for Coin to be able to build
and package only tests, but was a bit troublesome because that means
having to specify the usual boilerplate like minimum CMake version,
which packages to find in every tests.pro project.
Instead of having a separate standalone project, modify the top level
project and associated CMake code to allow passing a special
QT_BUILD_STANDALONE_TESTS variable, which causes the top level project
to build only tests, and find Qt in the previously installed qt
location.
This also means that when building a repo, we generate a
${repo_name}TestsConfig.cmake file which does find_package on all the
modules that have been built as part of that repo. So that when
standalone tests bare built for that repo, the modules are
automatically found.
qt_set_up_standalone_tests_build() is modified to be a no-op because
it is not needed anymore. Its usage should be removed from all the
other repos, and then removed from qtbase.
Non-adjusted tests/CMakeLists.txt projects in other repositories
should still be buildable with the current code, until they are updated
to the new format.
Adjust the Coin build instructions to build the standalone tests in a
separate directory.
Adjust pro2cmake to generate new structure for the tests/tests.pro
projects.
Adjust the qtbase tests project.
Fixes: QTBUG-79239
Change-Id: Ib4b66bc772d8876cdcbae1e90ce5a5a5234fa675
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Replace condition x86 to i386 to match other platforms.
Regenerate src/gui/CMakeLists.txt
Disable SSE4 on android x86 to match qmake.
Change-Id: Ic0d330206f2d70a79d72553aa3ff0f91ff58119c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Convert benchmark executables to add_qt_benchmark().
Currently add_qt_benchmark just calls add_qt_executable() and
ensures that it they build under CMAKE_CURRENT_BUILD_DIR and do not
install.
Add QT_BUILD_BENCHMARKS option to enable/disable building of benchmarks.
Change-Id: Id0bc676698d21d50048d97d9abef51d92ccb6638
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In qtvirtualkeyboard/src/plugins/lipi-toolkit/3rdparty/lipi-toolkit/src/lipicommon.pri
we have TARGET = $$TARGET$$qtPlatformTargetSuffix which keeps on recursing.
Change-Id: Ia0e020c7258cd87bba9b9681ed7b4568e8f0c9c2
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Had to teach the update program to accept category Lm as for
Joining_Transparent, for the sake of a new ArabicShaping.txt entry.
Added three new Unicode versions, several new scripts and a new
word-break class.
Updated UCD's test data for tst_QTextBoundaryFinder. This left 57
tests failing; I have commented out the data rows for those tests,
pending someone with more knowledge addressing this.
Task-number: QTBUG-79631
Task-number: QTBUG-79418
Change-Id: Ic33d3b3551195d47a84d98e84020f57a68f0b201
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Ran make format.
Change-Id: Ib4fc021c30834a69a9a5df653435dd92dc6a9c05
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If we do not encounter the load(qt_plugin) statement in the .pro file
but we do see the entry CONFIG+=plugin, treat the target as a regular
CMake library instead of treating it as a qt_plugin by default.
Change-Id: I67ad5c865a1a5ab691a6b0d86c2db4b686aa04dd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Released on October 4th.
Adds Windows names for two time zones, Qyzylorda and Volgograd.
Added languages Chickasaw (cic), Muscogee (mus) and Silesian (szl).
Norwegian number formatting has flipped back to using colon rather
than dot as time separator; it's flipped back and forth over the last
several CLDR releases. The dot form is present as a variant, the
colon form was long given as the normal pattern, then went away; but
now it's back as a contributed draft and that's what we pick up.
The MS-Win time-zone ID script was iterating a dict, causing random
reshuffling when new entries are added. Fixed that by doing the
critical iteration in sorted order.
Omitted locales ccp_BD and ccp_IN due to QTBUG-69324.
Task-number: QTBUG-79418
Change-Id: I43869ee1810ecc1fe876523947ddcbcddf4e550a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The Unicode data tables moved with QString and friends.
So did the locale data generated from CLDR.
This amends commit a9aa206b7b.
Change-Id: If12f0420b559dcb78993adc00e9f39751bca684a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is needed for tests/auto/gui/kernel/qguiapplication which includes
the qcoreapplication test. Without this change, the target name is taken
from the included .pro file, instead of from the current file.
Change-Id: I2d8a207fd70a49ad956fb9a83a59811d89682082
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
When adding resources inside a condition, we'd end up with lines
containing just spaces.
Change-Id: I623203d042e2492bdd72f97d8b9d90517040b0df
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Update configurejson2cmake.py to also write out the libraries compile
tests depend on.
Change-Id: I22dbc227a33b9b5d39a2198c6ee6062e7e1bf3de
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Add support to pro2cmake to convert java code for android.
Add support to override API_LEVEL for the Android sdk jar file. If the
sdk is not found, we'll default to the one located by QT_ANDROID_JAR.
Change-Id: If0b746dc7f9148ac43e6592a4a4dd23d46bbd4cd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
We cannot use a generator expression in an if statement, it does not
work. Instead, we could inspect the CMAKE_C/CXX_COMPILE_FEATURES list,
but unfortunately that's not reliable. For example it detects that ICPC
supports C++17 when in fact that depends on the installed libstdc++.
Therefore this patch revives our own configure tests.
Change-Id: Ic3bc5762fbe81837722523e3881ac16e84628519
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Calls to add_qt_resource from extend_target were not being wrapped in
a condition scope.
Change-Id: I78cf889fcf4663660fd870bfb93eec90a4ca1c47
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Only convert the architectures if they are in a stand alone form. This
means conditions such as 'if(x86 OR x86_64)', 'if(x86)', among others.
This also correctly converts statements such as 'equals(QT_ARCH,x86)'.
Change-Id: I1c3b8580ff9e4077c03a229d894d2bd3d95dba3d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Note the following bigger things that had to be done:
Handle GSS library / feature with a new custom find module.
Implement rudimentary support for relocatability (does not currently
handle extprefix).
Change-Id: Ic6cd27dda7ebca9829f51cb42ea76fff6d1767ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Don't globally map any variable use of QT_ARCH to ANDROID_ABI, as
that'll break if somebody uses it in a different context. Instead the
CMAKE_SYSTEM_PROCESSOR variable provides a reasonable value and it is
also set by the Android toolchain files.
Change-Id: Ibf203c39db586bbec5b800a365d83b3a509dbb62
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add condition replacements for the android ABIs.
Add a replacement for QT_ARCH to ANDROID_ABI, since QT_ARCH is only used
with the android build for now.
Change-Id: I553d7910546de32236f723ec2e9a05a18da76130
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Only print condition scopes when there is something to print.
Change-Id: I24151ca4834317940712b6173046abe91aac5628
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Translate checks like
contains(QT_CONFIG, c++11)
to
cxx_std_11 IN_LIST CMAKE_CXX_COMPILE_FEATURES
Also allows contains(CONFIG, c++11) and different versions of course.
Change-Id: I0f51a1ee7c92df6b87c31d0fb64c22fdba2002ec
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Make sure to process simd assignments in scopes by enclosing
the add_qt_simd calls into if blocks.
Change-Id: I3c7f2466cfa5bb0136d40deffb190ea8aabfb572
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
It's probably best to make it follow the usual calling convention that
the associated (consuming) target is the first parameter of the
function. So first this change accepts both formats.
Change-Id: I1f20706b23d5e819e0eb689eecedb3afb49df3b7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Provide a SKIP_INSTALL argument to add_qt_plugin for test cases with
plugins lacking install information.
Change-Id: Iddb3843fab1790d69d64686530a46057a2ff0477
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Now there are two of them, one used in qtbase and one in qtwayland.
In the future we should merge them.
Amends 08aba5ea0a
Change-Id: Ife98df28c762836277a02a34dd07e82ce7a1e871
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
There is agreement to use black for formatting, run it and make flake8
happy with its output.
Change-Id: I800d764a50cacba0eac1d8efb5c1dee0cf10a4ad
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
not in is considered easier to read and thus recommended (flake8) and
avoid one temporary name that is never used.
Adjust flake8 to be compatible with black formatting.
Change-Id: Ia049adb2344f11b53c78574972f6d9d670f4e66d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Fix invalid condition which would cause valid qt modules not to be
written out as modules.
Change-Id: Id4b408f2502a34c011595c4602145b6980ee9d58
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
At least setting the example install dir looks like a bug.
Change-Id: Ibcced739d05de5445fa455e509cc6f42b9ed935b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add add_cmake_library to allow us to create normal cmake targets using
all the information we have collected via the conversion script.
This function is only meant for tests. For an example,
see tests/auto/corelib/plugin/qpluginloader/lib/lib.pro.
Change-Id: I738cb8ac241b8da1a1da3ef957c24dc7a754d43f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Set the STATIC argument when we have 'static' in the qmake
configuration.
Change-Id: Ia8369bbd5ec4cfce0be51f36c61a811d53522729
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The code is nicely separated between parsing and processing. Splitting
that into two files makes it easier to follow which function belongs to
which part.
Change-Id: I576b8613b0d05b2dae3f9c6fa65d9ed5b582a0f7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The file parameter for a new Scope got renamed to qmake_file.
Change-Id: I6cb9d010892f3e3132fac09eead1dbf45d6ba86d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When we run into a plugin that does not have a type and is not a
qml plugin, we try to see if we can find the target installation path
and provide INSTALL_DIRECTORY AND ARCHIVE_INSTALL_DIRECTORY to the
add_qt_plugin call.
We run into this frequently with the unit tests.
This patch also changes add_qt_plugin() to use the value provided in
INSTALL_DIRECTORY for ARCHIVE_INSTALL_DIRECTORY if no value is provided
for the latter.
Change-Id: I61278904a4d2d72308079cd362bd085b4e2f540c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
When using run_pro2cmake, multiple pro2cmake processes try to access
and override the condition cache.
Make sure that reads / writes of the cache file are protected by
a file lock, and the content is merged rather than overridden.
This requires use of a new pip package, portalocker.
The script will tell the user to install it if it's missing.
Change-Id: I44798c46ff0912981b186bec40e3e918f249fb4d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Needed in tests/auto/corelib/plugin/qfactoryloader/test/ for example.
Change-Id: I5a2904e25d2895355fe11d4fc3e2e7c742346e42
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Do not replace framework libraries in examples as they tend to use only
system level frameworks.
Change-Id: Ide604b3ecc90f1f4c81b9ddaaa8e0a5acb486080
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Public/public libraries were always processed from the global scope.
Change-Id: I1223f04f100f91790ced1da41fda2fb9b52c5987
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Update example conversion to process scopes and conditions.
Change-Id: If1bbbd25092a8d5371b2d1fa2830d91e5aa591c5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
c.condition can be None, there is no point in adding it into the set of
conditions.
An example is tests/auto/corelib/codecs/qtextcodec/test.pro
Initializing the set to an empty set instead of None makes mypy happy,
since we could otherwise end up passing None where frozenset was expected.
Change-Id: If88a86d810b4c55aae7f1ee97a62db559abfc86d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
I broke the depends in 3a103b3608 wrongly
assuming it was dead code. Bring it back and actually fix the type to be
a list of tuples.
Change-Id: I96f04843ff2e2293969b5ba0efe02fb51dc88404
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Set the example install directory based on the path specified in
target.path qmake property.
Change-Id: Ia791995a3241fbf2f5ea1e48f2b9f93a90f1c3d7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Some of the changes are just cosmetic, but a bunch of them must be bugs,
such as mixing lists and str randomly.
Change-Id: Idd8340e17bcea7af3b87e595e251e13f5df1aa3f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Try not to override built-ins, the code becomes confusing to editors and people.
Change-Id: I9e9421e1506a206551ccfc550f882a075e208181
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Gets rid of new flood of QTRO_SOURCE_TREE unused commented lines
when regenerating projects.
Amends 152c593423
Change-Id: I5485643459078cd53face3080aa600df7d082595
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
...which is the source root of qtremoteobjects.
Set to CMAKE_SOURCE_DIR for now.
Change-Id: I6797e170749ed01bbc1bac4daa7709d3aae1f84b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Update add_qml_module() to use the new INSTALL_QML_FILES argument from
qt6_add_qml_module().
This patch also updates pro2cmake.py to remove the QT_QML_SOURCE_INSTALL
property from qml files.
Change-Id: I6623b2de76bb55bd6750e48f7d45c53ca536b391
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
If a CMakeLists.txt file has the special marker
# special case skip regeneration
then pro2cmake will skip the convertion of the .pro file that is
present in the same folder as the CMakeLists.txt file.
The --ignore-skip-marker can be used to force conversion of such
a project file.
Change-Id: I73aae742d1843148b5c22217cb3fc6b0f8e87b82
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
When invoking the script with "." as the only argument, and there
are multiple .pro files in the current directory, the script would
not choose the correct preferred .pro file (the one that has the
same name as the current directory).
Fix the sorter to handle such a case.
Change-Id: I6df70d7c577649f8854bca9b8879f13bdb1b4d26
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The unwrap_if handler just removed the if keyword from a condition
expression, and return the rest of the condition as-is. This proves
not be enough, because map_condition splits on spaces and tries
to map platform keywords, which would fail for values like "unix)".
Change unwrap_if to add additional space between the values in the
parentheses.
Change-Id: I769ab430363d008a9fd91eaba014c88bd5ee43bd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
CMake doesn't have a PROJECT_BUILD_DIR variable, but it does have a
PROJECT_BINARY_DIR variable.
Note that this might still be the wrong thing to do according to
35a30c7ebb , but it's still somwehat
better.
Change-Id: I493f82a791d933a16011d91774aaac4bcaffc5e5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
New option --skip-condition-cache allows forcing recomputation of
condition simplification.
Useful when debugging certain condition mappings.
Change-Id: I68a85c2e4085ad7a3043d7334db71a334a6469e9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The DEFINES -= QT_NO_LINKED_LIST is no longer needed, so just remove it
from .pro and CMakeLists.txt.
Handle $$[QT_INSTALL_TESTS] and $$TARGET in target.path.
When we have DESTDIR set, do not use target.path for OUTPUT_DIRECTORY.
Fixes: QTBUG-78219
Change-Id: I5161a955b25ff2f3b35428dc4b935a7c9d2d425b
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Test in QtQuickControls2 rely on this variable, which basically points
to the root of the project. We can't use PROJECT_SOURCE_DIR since it
will vary depending on whether we build tests as stanadlone or part
of the build.
Change-Id: Ic59a79af2b4b62611d6c32391c936e98e469dea0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
This fixes the qatomicinteger magic by making $$basename work for one
particular case.
qthreadstorage still needs investigation.
Task-number: QTBUG-78221
Change-Id: I7bb38f6ca24273bcf0443ab25685c8e815814c3c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Since at least one system provides config files without an included
target.
Change-Id: If1f336aab4cec9704412349d7951849ee8c3dabb
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
SOURCES -= foo.cpp statements should now be handled correctly by the
script. The script uses the same principle as for subdir handling:
go through all scopes to collect source removals, and then generate
new scopes with total conditions that take into account both
additions and subtractions and their conditions.
Should handle NO_PCH_SOURCES case as well.
Tested on gui.pro, network.pro and qtconnectivity bluetooth.pro.
Change-Id: I0cc913ef64cecf09e8ada4e6a3ce3ccb4365b44e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Store the results of simplify_condition in a json cache file,
next to the pro2cmake.py script.
Dramatically speeds up re-conversion of projects.
The cache is cleared whenever the content of the
condition_simplifier.py file changes, effectively presuming that the
condition computing code has changed.
Sample times.
Initial corelib.pro conversion - 142.13 seconds.
Next re-conversion with hot cache - 1.17 seconds.
Change-Id: I8790b2736358236e4b23bcb5f10f45a36fdfa426
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Add custom code to handle WINDOWS_SDK_VERSION comparisons,
similar to how it was done for QT_GCC_MAJOR_VERSION.
Also fix simplify_condition to do mapping of conditions to unified
tokens, similar how it was done for target conditions, so that the
simplification process does not fail because of whitespace.
Change-Id: Ia0cec6e1ffeed4c7859bb2a44423d0160222f425
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
We can't really handle this in a generic way now, because the values
of CONFIG() can not be directly mapped to features. It might be
possible in the future if we make sure that all configure.json entries
that have output publicConfig or privateConfig also generate a
feature. For now just hardcode the case.
Change-Id: Ie6b82b87973deb84012c3620b41920b343ffb2da
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
There was a missing f prefix for the f-string, and thus no
replacements were done.
Change-Id: If778d4ce25905c302de22a76c27af00a63f3c515
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
I haven't checked if the config for wayland-kms actually works, as that
requires building for a target that supports it (RCar M3 or similar).
Task-number: QTBUG-78177
Change-Id: Ib30a63a4e5feb955d17763c37e32ad3f2c13d358
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Do not stop the whole conversion if we encounter $$files(..., true).
Ignore the 2nd parameter for now.
Change-Id: If9334ce9719b98c33716dc7f18ba8aede05fe8b1
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
If the qml files are not listed in the qmldir file they do not need
to be written again, since it is expected that they are registered
by the c++ plugin code.
Change-Id: I624aedb182583f942bf1d1a322861c47a64b5065
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot