Commit Graph

2131 Commits

Author SHA1 Message Date
Sona Kurazyan
6585963583 Deprecate {QString, QByteArray}::count()
And remove their uses.

[ChangeLog][QtCore][Deprecation Notice] Deprecated QString::count()
and QByteArray::count() that take no parameters, to avoid confusion
with the algorithm overloads of the same name. They can be replaced
by size() or length() methods.

Change-Id: I6541e3235ab58cf750d89568d66d3b1d9bbd4a04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-12 01:05:45 +01:00
Joerg Bornemann
1d3b190425 qmake: Fix overlong command lines for static Qt builds on Windows
Linker response files for the MinGW and Unix makefile generators are
controlled by the variable QMAKE_LINK_OBJECT_MAX.  This variable holds a
number.  If the number of object files passed to the linker exceeds this
number, a linker response file containing object file paths is created.

This heuristic is extremely imprecise.  It doesn't take into account the
length of object file names nor the length of $$OBJECTS_DIR.

Also, when using a static Qt, a big part of the linker command line are
libraries.  A relatively small example can fail to link with "The
command line is too long" on Windows, even with the object files being
in a response file.

The MinGW makefile generator already reads the variable
QMAKE_RESPONSEFILE_THRESHOLD for compiler response files.  Re-use this
variable for the linker response file of the Unix and MinGW makefile
generators.

If QMAKE_RESPONSEFILE_THRESHOLD is set, use it to determine whether to
create a response file.  QMAKE_LINK_OBJECT_MAX is then ignored.  The
response file contains objects and libraries.

If QMAKE_RESPONSEFILE_THRESHOLD is not set, use QMAKE_LINK_OBJECT_MAX to
determine whether to create a response file.  The response file contains
only object files.

QMAKE_LINK_OBJECT_SCRIPT is used in both cases to specify a common base
name of all linker response files.

Pick-to: 6.2 6.3
Task-number: QTBUG-100559
Change-Id: I3c78354fa5ebb1a86438ec804679e0ee776c3f49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-02-21 12:37:19 +01:00
Thiago Macieira
8058127a9d QLibraryInfo: remove load-time variable
Since this is only used by qtpaths and qmake, let's not make every
application pay the price of dynamically initializing a QString whenever
QtCore is loaded (which 100% of Qt applications do). Instead,
initializing a null pointer costs zero and is one third the size of
QString. Even the assignment in qmake and qtpaths is faster this way.

Pick-to: 6.3
Change-Id: I6fcda969a9e9427198bffffd16ce8d1eb8dc19da
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 11:57:34 -08:00
Joerg Bornemann
9b2bf17f3e qmake: Print proper error if no .pro file could be detected
When passing a directory to qmake, it tries to detect a .pro file in
that directory.  Whenever the detection failed, qmake printed an error
message like "Access is denied." or "file to open is a directory".

Now, qmake prints an actually helpful error message:

    ***Cannot detect .pro file in directory '../foo'.

    QMake expects the file '../foo/foo.pro' or exactly one .pro file in
    the given directory.

Fixes: QTBUG-34673
Change-Id: I3d21ead247734172eee4eb68d3f9782d3ddaea52
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-02-02 19:36:42 +01:00
Joerg Bornemann
747bca3d67 qmake: Scan source files with QFile
The C API we've used so far underlies stronger restrictions regarding
path length than QFile.  Since qmake is not bootstrapped anymore, we can
use QFile.

Task-number: QTBUG-99791
Change-Id: Ic7765b0c09a8aa07c208c1b1d02efe0c54bb44f2
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-02 18:43:40 +01:00
Marc Mutz
be0dc7fbb8 QMake: replace a Q_ASSERT() with a Q_UNREACHABLE()
In release mode, the Q_ASSERT() is a no-op, and Clang rightfully
pointed out that, in that case, the bool ok variable will be used
uninitialized.

Fix by using Q_UNREACHABLE(), which has an effect in both debug and
release builds.

Pick-to: 6.3 6.2 5.15
Change-Id: I33480aabe1c5233d1caddf9404f475ca9fcb8eaf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-25 03:48:46 +01:00
Joerg Bornemann
9d15854138 Fix wrong QT_HOST_* values when qt.conf is present
When a qt.conf was present, QT_HOST_* variables got a wrong default
value.  For example, QT_HOST_BINS would end with /bin/bin.

We must not provide the defaults via QSettings::value(_, defaultValue).
The assignment of the default value is done in
QMakeLibraryInfo::rawLocation() separately after retrieving the value.

This amends commit 04ec14105e.

Pick-to: 6.3
Fixes: QTBUG-99656
Change-Id: I43431664e93ab40417a5432b03e7eb38ae21bad8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-01-12 18:28:24 +01:00
Joerg Bornemann
41f211d25f qmake: Print error and exit if a response file cannot be created
This is always an error, and we should not silently return an empty
string and pretend that everything is in order.

Drive-by change: Add a comment stating what createResponseFile()
returns.

Pick-to: 6.3
Change-Id: I4ee940cfac826c7ae5d15e977b692f1368ab29ea
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-01-08 18:08:12 +01:00
Joerg Bornemann
7246058dfd qmake/MinGW: Fix linking target name with whitespace
When having a TARGET value that contains whitespace, linking would fail
with MinGW.  This was, because the function createResponseFile stitched
together a file name like this:
    objectScript."Target Name".Release

The inner double quotes make the file name invalid.

Fix this by retrieving QMAKE_ORIG_TARGET with the var() method instead
of fileVar().  The latter quotes the return value if it contains
spaces.

Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-99522
Change-Id: Ieb7dcf3fbbd8a75de5a9b9a6beadb2170dddf35d
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-01-08 18:08:09 +01:00
Joerg Bornemann
4545d7d6a6 Doc: Mention how to interrupt/continue qmake loops
Fixes: QTBUG-99559
Pick-to: 6.3
Change-Id: Ib88bc0f93d7c0d6b9bf9a342410395f5a79675e5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-01-08 18:08:08 +01:00
Joerg Bornemann
64cac8b7be qmake/Xcode: Mark "Qt Preprocess" build phase as always out of date
This build phase executes the qt_preprocess.mak makefile from Xcode
and should be triggered whenever any input of any rule in this makefile
is out of date.  It was not triggered when a file that's referenced in
a .qrc file was changed.

The Xcode project lacks those files as rule input, but the makefile
itself has its inputs correctly set up, and can be triggered always.

Pick-to: 6.2 5.15
Fixes: QTBUG-94995
Change-Id: Ida1349039bd6f23a300a610ecbde96f7cd35edb6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-09 17:28:35 +01:00
Kai Köhne
69c38b4fd0 Fix size_t / int conversion warnings in qmake
Fixes

  qtbase\qmake\generators\makefiledeps.cpp(985): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data
  qtbase\qmake\generators\makefiledeps.cpp(986): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data

Pick-to: 6.2
Change-Id: I7c6b4f36dc383db420c10d674666d58dbf29d2dd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-12-02 15:16:49 +01:00
Marc Mutz
a0f9aef11b Long live Q_GADGET_EXPORT!
Like Q_NAMESPACE_EXPORT for Q_NAMESPACE, this variant of Q_GADGET
allows passing an export macro. This is useful to avoid exporting the
whole class just to get the staticMetaObject hidden therein exported.

Before anyone asks: No, we don't need Q_OBJECT_EXPORT, because QObject
subclasses, being polymorphic, always need to have a class-level
export macro (to export their vtable), but while that technique also
works for value classes (the Q_GADGET audience), it is not desirable
for them, because it makes inline functions exported in Windows debug
builds, which is not what we want, because it needlessly restricts
what you can to with the inline functions (e.g. remove).

[ChangeLog][QtCore] Added the Q_GADGET_EXPORT macro, which is like
Q_GADGET, but allows passing an export macro (like Q_NAMESPACE_EXPORT
for Q_NAMESPACE).

Fixes: QTBUG-55458
Change-Id: I546297de1e8aa45d83381991bcd3fbca61e1eef0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-11-27 01:25:10 +01:00
Marc Mutz
f8ab1f0576 qmake: use even fewer magic numbers
De-unroll the loop over the "interesting" keyword ignore comments by
using the existing array of their names. Replace magic numbers by
strlen() calls. Use local starts_with() instead of strncmp() when
comparing with fixed-size constant string literals, to avoid repeating
the fixed string's lengths for the third argument of strncmp().

Task-number: QTBUG-55458
Change-Id: If458aced382948fb719d984702857fb2171c87ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-11-26 18:28:50 +01:00
Marc Mutz
5750a9728e qmake: don't use magic numbers
Use a local enum to enumerate the different "interesting" keywords.

Task-number: QTBUG-55458
Change-Id: I30a6336072d3184b720d8c016f199572dba87a81
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-11-24 10:47:10 +01:00
Yuhang Zhao
e01c25e859 QtBase: replace windows.h with qt_windows.h
We have some special handling in qt_windows.h,
use it instead of the original windows.h

Change-Id: I12fa45b09d3f2aad355573dce45861d7d28e1d77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-11-23 12:53:46 +08:00
Joerg Bornemann
610123b1c8 Move the 'qmake' feature to src/tools/configure.cmake
This allows us to present 'qmake' in the tool-related section of the
configure summary.

Change-Id: I897dec23cb0608706ec01d9b91283dbce92b293f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-19 20:44:51 +01:00
Joerg Bornemann
04ec14105e Change qt.conf key Qml2Imports to QmlImports
[ChangeLog][qt.conf] The key Paths/Qml2Imports has been renamed to
Paths/QmlImports. For backwards-compatibility, Paths/Qml2Imports is
still accepted and acts as default value for when Paths/QmlImports is
not present.

Fixes: QTBUG-98335
Change-Id: If7ffedd281eb8a87e8ab1a2b69a823e615c33541
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-11-19 16:44:32 +01:00
Venugopal Shivashankar
f9e6ee655f Doc: Fix qdoc warnings
In addition, added the missing warninglimit
entry to a few doc configs.

Change-Id: I51b9d2ad66123a2a9673a3b42870662641375e6b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-11-11 11:34:49 +01:00
Joerg Bornemann
3582116a60 qmake: Introduce the variable MSVC_TOOLSET_VER
...which represents the version of the MSVC platform toolset.

This variable is used to set the platform toolset version in .vcxproj
files.  Before, the platform toolset version was determined in qmake's
C++ code.  Now, it's set next to where MSVC_VER is set in common mkspecs
.conf files.  This will simplify supporting new Visual Studio versions
in the future.

Change-Id: If78c921f93c6378829746d617c7e7d312174257e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-10 14:47:42 +01:00
Joerg Bornemann
1c880752eb qmake: Support Visual Studio 2022
Extend the detection of the MSCV_VER variable and make VS 2022 known to
the vcxproj generator.

[ChangeLog][qmake] Added support for Visual Studio 2022.

Pick-to: 6.2 5.15
Fixes: QTBUG-97975
Change-Id: Id2c0a0b7800f721e9e34189f0a40ba4830283578
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-10 13:47:42 +00:00
Joerg Bornemann
e022ff0a8e qmake/vcxproj: Fix "CONFIG += combine" extra compilers
Extra compilers with "CONFIG += combine" were broken for qmake's vcxproj
generator since forever.

Usually, extra compilers are handled by attaching the Custom Build Tool
to the input file.  This is not possible for combine extra compilers,
because they map multiple inputs to one output.  We cannot attach the
Custom Build Tool to the output either, because this would result in
circular dependency errors (output trying to create output itself).

To fix this, we create a custom build tool fake file (.cbt) for the
output and attach the Custom Build Tool there.  This is the same trick
we do for regular extra compilers that have C++ sources as
input (e.g. the one that generates moc_predefs.h).

Pick-to: 6.2 5.15
Fixes: QTBUG-94806
Change-Id: Ib808a43fead737df91b89a1ac5e180aeae37efae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-25 18:10:43 +02:00
Joerg Bornemann
3681369120 qmake: Make some debug code actually compilable
Change-Id: Ia57b0d83ba3bf005d7d19e7958bb7131c7dc50b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-25 16:37:38 +02:00
Joerg Bornemann
1a44090df5 qmake/vcxproj: Fix malformed <Message> tags
Extra compilers and the command set to "\n" would result in malformed
<Message> tags in vcxproj files.  Those tags are used to display the
name of the extra compiler when building.  Setting the extra compiler's
command to "\n" is a common trick to force the creation of the rule.

Make sure to trim the command name that is created from the extra
compiler's command to avoid such new-line-only bogus message tags.

Pick-to: 6.2 5.15
Change-Id: I1bae28ed14c438d777f96280c6b2cf5ca315b51c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-25 10:10:08 +02:00
Joerg Bornemann
a0e56294c1 Skip unnecessary commands when cross-building tools
Introduce a new macro qt_internal_return_unless_building_tools which
simply calls return() if tools are not built.  This macro is supposed to
be called after qt_internal_add_tool().

Using this macro avoids having to special-case code for when
qt_internal_add_tool() creates imported targets in cross-builds.

Adjust pro2cmake accordingly.

Task-number: QTBUG-85084
Change-Id: I9e1c455c29535dd8c318efa890ebd739c42effc1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-09-27 16:34:23 +02:00
Edward Welbourne
298e41b830 Remove fatuously true or false QT_VERSION checks
QT_VERSION is now at least QT_VERSION_CHECK(6, 3, 0), so remove all
checks against Qt 6.0.0 or earlier. They are superfluous. Tidied up in
some places in the process, particularly #include order.

Change-Id: I2636b2fd13be5b976f5b043ef2f8cddc038a72a4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-09-23 16:57:03 +02:00
Venugopal Shivashankar
7d475a8656 Doc: Fix broken links
Task-number: QTBUG-96569
Pick-to: 6.2 6.2.0
Change-Id: If7e951c3df72a87a04e802a5eadbc01c4d934765
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-09-17 13:01:46 +00:00
Joerg Bornemann
b5a23e88be qmake/xcode: Do not create OBJECTS_DIR
If we create OBJECTS_DIR at qmake time, Xcode will not consider this
directory as created by the build system, and "xcodebuild --clean" will
fail.

Prevent qmake from creating that directory in the Xcode generator.

Pick-to: 5.15 6.2
Fixes: QTBUG-96305
Change-Id: I874bf34a4289ce5f2d3e2ce070ffbe56d5368861
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-10 15:40:49 +02:00
Kai Köhne
c104af4c44 Doc: Remove unsupported customFilters
customFilters defined in .qdocconf are not supported anymore by Qt
Assistant since Qt 5.13. Therefore remove them from all .qdocconf files,
also to avoid cargo-culting them to new help modules.

Task-number: QTBUG-95987
Change-Id: I664391460637d2e859348da0338e1a4a3ee9f570
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-09-03 15:14:59 +00:00
Juha Vuolle
17d7a8dc2e Update Android default SDK from 29 to 30
By the time of Qt 6.2 release all new apps targeting Play store must
target API level 30 (Android 11) or above (starting in 08/2021 for
new apps and 11/2021 for existing apps' updates).

Pick-to: 6.2 5.15
Task-number: QTBUG-94451
Change-Id: Id7fa2fd62899a7259e365c917292c6c3ac0d2b0d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-08-27 18:31:17 +00:00
Joerg Bornemann
9004575f4b qmake: Add support for C17/C18
Make it possible to select the C17/C18 standard with
  CONFIG += c17
or
  CONFIG += c18

Pick-to: 6.2 5.15
Fixes: QTBUG-96026
Change-Id: I719d22366c3efda009118d58ead173a25ed285c0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-26 18:32:44 +02:00
Joerg Bornemann
a6a216e310 qmake/vcxproj: Read C language standard from QMAKE_CFLAGS
The vcxproj generator completely ignored QMAKE_CFLAGS and did only read
QMAKE_CXXFLAGS.  The msbuild-internal "cl compiler tool" contains the
flags for both, C and C++.  It is to risky to take all QMAKE_CFLAGS into
account for the "cl compiler tool", because this might collide with what
is specified in QMAKE_CXXFLAGS.  Therefore, we only read the
/std:... compiler option from QMAKE_CFLAGS and set the
LanguageStandard_C flag in the msbuild file.

Pick-to: 6.2 5.15
Task-number: QTBUG-89296
Change-Id: I885061802c1350b293a7868d4c9a9367d30e2380
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-26 18:32:44 +02:00
Joerg Bornemann
5e98769602 qmake/vcxproj generator: Handle C standard compiler flags
Handle the compiler flags /std:c11 and /std:c17 and turn them into the
values stdc11 and stc17 for the LanguageStandard_C tag.

Drive-by change: Add /std:c++20 to the list of known C++ standard
options.

Pick-to: 6.2 5.15
Task-number: QTBUG-89296
Change-Id: Ia575fff611bdf795406db84bd34057d008c8a383
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-26 18:32:44 +02:00
Joerg Bornemann
b073de274d qmake: Recognize MSVC 16.x as VS 2019 in the VS project generator
In a subsequent comment we will set the qmake variable MSVC_VER to 16.8
to check for the availability of certain compiler flags that were
introduced in that compiler version.

The old code compared exact version strings.  With this patch we're
checking version ranges instead and handle MSVC_VER 16.x as VS 2019.

Pick-to: 6.2 5.15
Task-number: QTBUG-89296
Change-Id: I9ea24a66f68a342a72f5c2a285bafacb8786661b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-26 18:32:44 +02:00
Joerg Bornemann
a477a56d5b Doc: Note that qmake's CONFIG values are case-sensitive
Pick-to: 5.15
Fixes: QTBUG-95827
Change-Id: Ie7b373c547b04a0ebe0b4b93dd0ec0c12e445b2e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-18 14:17:29 +00:00
Joerg Bornemann
b9e8d85fb2 Fix framework dependencies in .la files
"-framework Foo" arguments must be placed in the inherited_linker_flags
variables instead of dependency_libs.

Pick-to: 5.15
Fixes: QTBUG-2390
Change-Id: Idec4115533ed1f86f44db64931fa64cadeeb4572
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-17 23:35:23 +02:00
Li Xinwei
a251443949 Avoid to call _qt_internal_set_up_static_runtime_library() twice
Pick-to: 6.2
Change-Id: I28985470b3e0b88befbbd2d62a027670d7d6c822
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-03 04:18:42 +08:00
Tor Arne Vestbø
7c14223b1e testlib: Update a few remaining instances of the deprecated -xunitxml format
The format was renamed in 27db9e458c.

Pick-to: 6.2
Change-Id: I53975c7467d8768dc9dc9ac2d89c42eefa12e22f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-29 18:46:39 +02:00
Marc Mutz
25fff849e8 QDirIterator: add nextFileInfo()
Before this change, next() was the only way to advance the iterator,
whether the caller was ultimately interested in just the filePath()
(good) or not (bad luck, had to call .fileInfo()).

Add a new function, nextFileInfo(), with returns fileInfo() instead.
Incidentally, the returned object has already been constructed as part
of advance()ing the iterator, so the new function is faster than
next() even if the result is ignored, because we're not calculating a
QString result the caller may not be interested in.

Use the new function around the code.

Fix a couple of cases of next(); fileInfo().filePath() (just use
next()'s return value) as a drive-by.

[ChangeLog][QtCore][QDirIterator] Added nextFileInfo(), which is like
next(), but returns fileInfo() instead of filePath().

Change-Id: I601220575961169b44139fc55b9eae6c3197afb4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-28 15:16:42 +02:00
Nico Vertriest
8ccd5d5af2 Doc: Fix link errors in qmake manual
- Replaced # with / after link prefix "Qt for macOS"
- added definite article
- punctuation issue
- Added prefix "Qt for macOS/" to one link, and
  changed "macOS Version Dependencies" to "Supported Versions"

Fixes: QTBUG-90662
Change-Id: Ib2e48ee477e8d34fece64d6dea1f86fe73f09478
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-07-28 14:40:10 +02:00
Marc Mutz
a7564e2657 QDuplicateTracker: accept the number of elements to reserve as a ctor argument
This prevents us from first reserve()ing Prealloc elements, and then
possibly reserve()ing a larger number, which leaves the first bucket
list's memory unused.

Consequently, deprecate reserve().

Change-Id: Ifc0a5a021097f4589557e7b5e45d9d0892797ade
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-14 08:57:39 +02:00
Joerg Bornemann
d6e01ae05c Fix QT_HOST_DATA for builds setting INSTALL_MKSPECSDIR
In a Qt build that was configured with INSTALL_MKSPECSDIR set to
something different than INSTALL_DATADIR, the qmake property
QT_HOST_DATA was wrong. Consequently, mkspecs could not be loaded,
rendering qmake dysfunctional.

The reason was that we considered every QT_HOST_xxx property to have the
same value as QT_INSTALL_xxx in a non-cross build.
This is not true for QT_HOST_DATA, because users might want to set
INSTALL_DATADIR to "foo" but INSTALL_MKSPECSDIR to "bar/mkspecs".

Move the unused determination of the host data dir to the QtLibraryInfo
lib and handle QT_HOST_DATA specially.

Fixes: QTBUG-94591
Pick-to: 6.2
Change-Id: I2c44cda8405ff1d14391254fcd1d9b1361cb5855
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-23 22:12:41 +02:00
Li Xinwei
208dbb4c18 qmake: fix MSVC build error when QT_FEATURE_static_runtime is ON
error LNK2038: mismatch detected for 'RuntimeLibrary': value
'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'.

Change-Id: I1422bdc680a066f0736c3e28cc6beafd2461db88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-19 04:03:46 +08:00
Alexey Edelev
43ba45151a Follow the generic logic of QLibraryInfo when computing QT_HOST_PREFIX
After the discussion we concluded that QT_HOST_PREFIX should not
completely replicate the QT_INSTALL_PREFIX behavior.

So this patch implements the following logic if qt.conf is provided:
  1. Prefix is not set
    a. If HostPrefix is not specified, then QT_HOST_PREFIX will be set
       to the folder containing qt.conf.
    b. If HostPrefix is specified and is relative, then QT_HOST_PREFIX
       will be relative to the folder containing qt.conf.
  2. Prefix is set
    a. If HostPrefix is not specified, then QT_HOST_PREFIX will have
       the Prefix value.
    b. If HostPrefix is specified and is relative, then QT_HOST_PREFIX
       will be relative to the folder containing the qt.conf.

The logic might change in a future commit to use the current application
directory instead of qt.conf path, since the use of qt.conf is dictated
by the bootstrap library and this is no longer the case.

Fixes: QTBUG-93707
Change-Id: I5460c97c45924bb8e0c95493afdb9585994c5f28
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-18 20:57:25 +02:00
Robert Löhning
08c852be43 qmake: Clear caches before exiting
To not scare sanitizers and their users.

Change-Id: I51de5d6a5a358b3cf1355aeb6cc826a6ac021243
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-06 23:49:20 +02:00
Kai Köhne
fb56cf449b doc: Mention qmake6 as name of qmake executable on Linux
Task-number: QTBUG-89170
Pick-to: 6.1
Change-Id: I16c86f04b4c34e7099c220cf028ba1cdb20550e9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-05-05 20:31:26 +02:00
Joerg Bornemann
63a812b851 Fix "qmake -spec foo" call for cross builds
In a cross built Qt, for example Qt for Android, calling "qmake -spec
android-clang" led to an error message:
    "Could not find qmake spec '-qtconf'."

This happened, because:
- the qmake in Qt for Android is a wrapper script that calls
  "qmake -qtconf qt_target.conf -spec android-clang"
- the first stage of command line argument handling in qmake garbled the
  call to "qmake -spec -qtconf qt_target.conf android-clang"

We do not modify the order of arguments anymore.

Instead, we skip the "-qtconf <file>" arguments in the first argument
handling stage that is supposed to determine qmake's modus
operandi (like -project or -query).

In addition, we need to fix the assignment of
QLibraryInfoPrivate::qtconfManualPath which was only done if
QMakeGlobals::addCommandLineArguments returned ArgumentsOk. However,
this function returns ArgumentUnknown, if it encounters an argument it
cannot handle - like the project name.
Now, we assign QLibraryInfoPrivate::qtconfManualPath if there was no
error detected.

Document the return values of addCommandLineArguments.

This amends commit 661b586a69.

Pick-to: 6.1 6.0
Fixes: QTBUG-93079
Task-number: QTBUG-85136
Change-Id: I12ec25b17d64c00be2a3904b7c4a975b781500a0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-26 10:59:32 +02:00
Jonas Karlsson
6b1a7341fe Fix infinite loop in qmake option parsing
If calling 'qmake -qtconf file' an infinite loop occurs.

Bug introduced in 661b586a69

Pick-to: 6.1 6.1.0 6.0
Change-Id: I3ccc067570308227b605d700b41b299800aa872a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-22 16:31:06 +00:00
Kai Köhne
bf65abc4ab qdoc: Name section 'Getting started with qmake'
Other manuals have a 'Getting started' section too. Better to qualify
it further, so that searching in the Index of Qt Creator Help mode or
Qt Assistant allows to differentiate between the different products.

Pick-to: 6.1
Change-Id: I7cfdba3c3567bdf49d3fe34307576f88c9f20126
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-04-22 14:48:46 +00:00
Christoph Keller
8115219407 Explicitly set input files for qtpreprocess
This fixes build errors with Xcode 10.
Xcode 10 build system (a.k.a "New Build System") needs to know the input files
in order to build a correct dependency graph. Especially when a build is not run
for the first time and files changed in-between.

Task-number: QTBUG-71035
Pick-to: 6.0 6.1 5.15 5.12
Change-Id: If8fbad3a1915add9b35c79131b03cdbe6b7ac06d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-04-12 11:36:32 +02:00
Nikolay Avtomonov
3f0858ed10 Explicitly set output files for qtpreprocess
This fixes build error with XCode 10.
XCode 10 build system (a.k.a "New Build System") requires all the files
that are generated by scripts and used later on build to be explicitly
defined as output files.

Task-number: QTBUG-71035
Pick-to: 6.0 6.1 5.15 5.12
Change-Id: Ibec39eee53b0cb3acecf592f1ca53c04b9975cad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-04-07 17:14:37 +02:00
Joerg Bornemann
9f444ce533 Add a way to install versioned hard-links for tools
Add the option argument INSTALL_VERSIONED_LINK to qt_internal_add_tool
and qt_internal_add_app. For tools/apps with this argument we create an
install rule that creates a versioned hard link. For example, for
bin/qmake we create bin/qmake6.

Note that this only applies to prefix builds.

Apply this argument to qmake.
The qt_internal_add_app change is necessary for qtdiag and in qttools.

Task-number: QTBUG-89170
Change-Id: Id32d6055544c475166f4d854aaeb6292fbb5fbb5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c19d957f45fa27f61b5ecc566f8dbc19f12a44c3)
2021-03-25 16:31:39 +01:00
Joerg Bornemann
567b154ba7 Fix warning when building qmake with MSVC
Fix the C4715 warning for 'hostToTargetPathEnum' by marking the qFatal()
branch as unreachable.

Change-Id: Id065daaffd865e85985b1a8e0ac2eba4a2ff0b1c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-22 22:32:56 +01:00
Alexey Edelev
6fb569af95 Unify QLibraryInfo settings
Exporting QLibraryInfo internals allows to reuse settings in
qmake/qtpath without having to keep its own instance.
Also there is no need to check setting groups in QLibraryInfo
except the 'Paths' group, since this logic belongs to qmake/qtpaths
only.

Change-Id: If762defba025ad7f7489f8a86ef5768a8628bd2f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 11:57:11 +01:00
Alexey Edelev
5db8579620 Add support for various output formats for QMakeProperty
Add the ability to select a standard and json output formats of
the Qt properties. This patch also improves the encapsulation of
QMakeProperty.

Change-Id: Ib1d232be1b430ed8456ce65cc98141282e4c3f7f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-12 13:20:00 +01:00
Alexey Edelev
fd3c417af9 Move the common qmake sources into a object library
Some qmake sources could be reused by other tools. It makes sense to
move such sources to the object library, to avoid additional compilation
steps and to simplify the reuse of sources.

Change-Id: I9d7bb7624019149d34d29e4b269b4f26b8aec7a4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 15:46:34 +01:00
Joerg Bornemann
e158d699e0 Remove all qmake-related data from q[make]config.cpp
Now that we're not actually using qmakeconfig.cpp anymore, we can remove
it together with all qmake-related information that was written into
qconfig.cpp.

This also moves the qtConfEntries array back to qlibraryinfo.cpp.

Change-Id: I5e57d8c55613332cc3e57b11df4398d46aed259b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 10:00:18 +01:00
Joerg Bornemann
9f5a7cb5fa qmake: Do not read from qmakeconfig.cpp
Change-Id: I6a46c2e817f8dc3f580774aba2db8bfb01f5a403
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 10:00:11 +01:00
Joerg Bornemann
a08b1f6359 Read QLibraryInfo paths directly from QLibraryInfo and not from qmakeconfig.cpp
Change-Id: I1db1c871ec6b4e572bd36df6aff7a5be8a4a706c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 10:00:01 +01:00
Joerg Bornemann
3c12ab974f Pass target and host mkspec as defines to QMakeLibraryInfo
Change-Id: If07055286496c507310c0dbb3a06f1a42d643596
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 09:59:56 +01:00
Joerg Bornemann
c651e7ba18 Do not write Sysroot and SysrootifyPrefix into qmakeconfig.cpp
Those have fixed values.

Change-Id: I7f1ba8036f43413d3c805f4b419ae79e037343fb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 09:59:51 +01:00
Joerg Bornemann
504d0c3755 qmake: Delegate prefix deduction to QLibraryInfo
Now, that qmake depends on QtCore, we can just ask QLibraryInfo for the
prefix instead of calculating it from QT_CONFIGURE_RELATIVE_PREFIX_PATH.
Remove that define.

Change-Id: I14be298a9d08abf33299e4cdbac55e91af318397
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 09:59:47 +01:00
Joerg Bornemann
b788c87457 QMakeLibraryInfo: Move reading of default values into separate function
Reduce code duplication.

Change-Id: Ic20c124ad664d16552e3cfea8dde465fc0b6066f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 09:59:42 +01:00
Joerg Bornemann
17055f5f48 Remove the platformsSection constant from qconfig.cpp.in
This is not configurable and doesn't have to be in the generated
q[make]config.cpp files.

Change-Id: If294d735800a3b5c6b3e269abdd86df401cf4864
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 09:59:27 +01:00
Alexey Edelev
1f8f13cbe7 Add the 'FEATURE_qmake' feature
Add a conditional build of the qmake.

Task-number: QTBUG-89369
Change-Id: I8d7968ffb20ea31df2f85fff055e0d131ed06a36
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-04 09:49:44 +01:00
Joerg Bornemann
b1ad7f938e Generate information about user-facing applications in build dir
When packaging different Qt versions for Linux distributions (or any
distribution with a common bin dir), Qt tools cannot be installed to
/usr/bin, because the executable names of the different Qt versions
clash.

To solve this conflict, our recommendation is to install Qt's tools to
/usr/lib/qt6/bin and to create versioned symlinks to user-facing tools
in /usr/bin.

User-facing tools are tools that are supposed to be started manually by
the user. They are marked in Qt's build system. Distro package
maintainers can now configure with
  -DCMAKE_INSTALL_PREFIX=/usr
  -DINSTALL_BINDIR=/usr/lib/qt6/bin
  -DINSTALL_PUBLICBINDIR=/usr/bin
and will find a file called user_facing_tool_links.txt in the build
directory after the cmake run. Nothing will be installed to
INSTALL_PUBLICBINDIR.

Each line of user_facing_tool_links.txt consists of the installation
path of a user-facing application followed by a space and the versioned
link name in INSTALL_PUBLICBINDIR.

Example content:
/usr/lib/qt6/bin/qmake /usr/bin/qmake6

To actually create the versioned symlinks, the content of this file can
be fed to ln like this:
  xargs ln -s < build-dir/user_facing_tool_links.txt

Or the package maintainer may decide to do something completely
different as suits their needs.

This patch adds the USER_FACING argument to qt_internal_add_tool to mark
tools as user-facing. In addition, every Qt created by
qt_internal_add_app is treated as user-facing.

The only tool this patch marks as user-facing in qtbase is qmake.

Pick-to: 6.1
Fixes: QTBUG-89170
Change-Id: I52673b1c8d40f40f56a74203065553115e2c4de5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-03-02 22:00:51 +01:00
Alexey Edelev
5dab1e931d Improve QMakeLibraryInfo encapsulation
QMakeLibraryInfo uses external data to produce paths. This causes
issues when trying to use it out of the existing qmake environment.
Add data fields that contain the path to the binary that uses
QMakeLibraryInfo and manually specified qtconf.

Task-number: QTBUG-75870
Change-Id: Ic6fa274ede3a9287826ff66c79f155b10d0d455c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-01 17:37:03 +01:00
Alexey Edelev
d1101c460e Simplify prefix-related functionality of qmake
Since the QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH and
QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH definitions keep the same
value in modern CMake build, no need to have special handling in cases
where these values are used in qmake. Also it will be useful to
specify the relative path to the prefix directory from the directories
different of 'bin' when use QMakeLibraryInfo.

Task-number: QTBUG-75870
Change-Id: I5a777001eb334dcf05e22853a514d4257352d59b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-01 17:36:56 +01:00
Alexey Edelev
93f55570c4 Remove unused definitions
QT_CONFIGURE_CROSSBUILD is always '0', so it's not necessary to keep
conditional compilation in QMakeLibraryInfo.

Also the QT_CONFIGURE_SYSROOTIFY_PREFIX definition is never used
in the project.

Task-number: QTBUG-75870
Change-Id: I1fe42dce40fddc6a72254736883f93aa4727f6b3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-01 17:36:48 +01:00
Alexey Edelev
43c28aa904 Use Core library for qmake instead of the Bootstrap library
Move the qmake-specific logic of the QLibraryInfo class to
qmake internals. 'qconfig.cpp.in' now stores information about
the library info entries to keep them consistent between qmake
and the Core library. qmake requires specific features enabled
in the Core library, so building qmake will be skipped if the
features are not enabled.

All flags directly related to the qmake have been removed from
Core lib.

Remove all bootstrap related sections from qmake CMakeLists.txt

Task-number: QTBUG-89369
Change-Id: I26de157d3bfd4a5526699296e9d46e1c180b89ae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-25 16:08:43 +01:00
Kai Köhne
8f1c4019e5 qmake: Update documentation that c++17 is the default
Since commit 4933a5f892, CONFIG contains C++17 by default.

Change-Id: I1033c256242c03d79a643c12a63d17eb9f4c705f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-19 09:59:14 +01:00
Joerg Bornemann
edd1225489 qmake: Introduce QT_HOST_LIBEXECS property
This will be used to access host tools that are installed in
${prefix}/libexec instead of ${prefix}/bin.

Pick-to: 6.1
Change-Id: I36c4b5736330f8229d267a117c65d55cd5e12758
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-18 11:46:42 +01:00
Kai Köhne
3c412c93c2 Update name of c++2a to c++20
Keep the c++2a feature, but make it an alias for compatibility
purposes.

Pick-to: 6.1
Change-Id: I6f153109be84659806f1b7a57a88a187875166d8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-10 07:54:06 +01:00
Joerg Bornemann
134ee7d932 qmake: Introduce compile_included_sources CONFIG option
By default, qmake does not compile source files that are included in
other source files. The new CONFIG option compile_included_sources
disables this behavior.

Pick-to: 5.15
Fixes: QTBUG-90801
Change-Id: I60c997938895f3a743d32ea385efdbe6bcf315bb
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-08 12:07:54 +01:00
Ulf Hermann
4e5d0cf5e5 QLibraryInfo: Rename Qml2ImportsPath to QmlImportsPath
The "2" is meaningless. We retain the old name as alias for source
compatibility, but we don't document it anymore.

Task-number: QTBUG-85064
Change-Id: Id10d58f6d39a0faaec042304b374ae6b23469362
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-02-08 11:00:12 +01:00
Alexey Edelev
295d4d6955 Remove usage of the definitions that are never defined
The QT_BUILD_QMAKE_BOOTSTRAP and QT_BUILD_QMAKE_LIBRARY definitions
are never defined in the project since migrating to CMake build.

Change-Id: I7108c92387005a2fde6ebdb2d74843e3efc6413e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-01 14:34:41 +01:00
Ralf Habacker
ab2c61e638 If available, use a version-specific qt<major-version>.conf
To enable the current Qt version to use a qt.conf that is independent
from the previous version, a file named 'qt<major-version>.conf' is
searched for first. If this file does not exist, a file with the
name 'qt.conf' is searched for.

Task-number: QTBUG-88635
Change-Id: If75b63f72a7bdbdf1de7729ea4ecb00810b58d12
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-01-14 23:30:47 +01:00
Joerg Bornemann
04f11f9935 Remove .prev_CMakeLists.txt files
Those serve no purpose anymore, now that the .pro files are gone.

Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-12 20:59:13 +01:00
Giuseppe D'Angelo
c34c6af374 Replace some more erase/remove patterns with removeIf
Change-Id: I6c6f33450fbfd798e5ef71a8ba18f590581dc3a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-10 15:02:47 +01:00
Joerg Bornemann
ad2da2d27a Remove the qmake project files
Remove the qmake project files for most of Qt.

Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.

Also leave the qmake project files for utils and other minor parts that
lack CMake project files.

Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-07 15:32:28 +01:00
Hou Lei
2d58620140 Adjust the format of code blocks
Change-Id: Id4a98b8b6f66ea4ea18eb90b86c1b84b6342e825
Reviewed-by: Hou Lei <houlei@uniontech.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-04 18:09:55 +08:00
Joerg Bornemann
31396f0aff Remove qmake-related code from configure
This leaves a very simple script that delegates the heavy configure work
to a CMake script.

This also removes the Makefile templates that were used for
bootstrapping qmake.

Task-number: QTBUG-88742
Change-Id: Iab9c477e0bb611d680bda2cf8aaa7ad88356a8d1
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-12-21 10:33:33 +01:00
Alexandru Croitor
2304acab5f CMake: Regenerate projects using pro2cmake one last time
And fix up some wrong qmake project files

Pick-to: 6.0
Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-10 11:52:30 +01:00
Marc Mutz
105a66e654 Use (new) erase()/erase_if() algorithms
Change-Id: I45c18fd45c20b226e44d16315e3ebb6c305d4ab0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-05 00:47:44 +01:00
Joerg Bornemann
21e7777230 Fix undefined behavior in ProString/ProKey::appendTo
We must not pass null pointers to memcpy.

Pick-to: 6.0
Fixes: QTBUG-88780
Change-Id: Ic1d77b4672310a3f6d0d4fbee5f2889e3e4d219d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-12-02 10:21:45 +01:00
Andreas Buhr
0440614af0 Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with
move semantics, its name is misleading. Q_RELOCATABLE_TYPE was
introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE
is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE
by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this
patch should have no impact on users.

Pick-to: 6.0
Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-30 17:16:21 +01:00
Fabio Falsini
88ab9e1800 Change android target SDK version to 29
Play Store now accept only app with target
SDK version set to 29 or above

Pick-to: 6.0
Change-Id: If38f20c88fd6b0e6f29939cdf3d2eb793c0e1489
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-11-26 20:05:41 +01:00
Joerg Bornemann
032c536644 qmake: Sync back changes from qttools
Copy back changes to qmake internals that were done in qttools.
This makes it easier to keep the qmakelib copies in sync.

The code guarded by PROEVALUATOR_CUMULATIVE is not used by qmake itself,
but only by lupdate and Qt Creator. It seems to be sensible to have the
same behavior with regards to feature file evaluation in both
projects. It was originally introduced in qttools for QTBUG-62478.

The change regarding QT_BOOTSTRAPPED is safe, because the 'process'
feature is available and off in the boostrapped case.

Change-Id: I030ca8b093c017040a9ff9f4bb09a7cca4aa8964
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-26 20:05:41 +01:00
Joerg Bornemann
116c2115f8 Doc: Fix documentation of qmake's exists() function
This function may take a wildcard expression, not a general regular
expression.

Pick-to: 5.15
Change-Id: Ia7ba3bac47c310bc035620583b9d2102fdc5ffb0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-11-24 18:54:45 +01:00
Giuseppe D'Angelo
784a290c4b QFileInfo: mark constructors as explicit
These look like leftovers (API flaws).

Construction of QFileInfo from QString (or similar) should be not
implicit, as QFileInfo construction is expensive (might hit the file
system), and this may have users overlook APIs (for instance build a
QFileInfo out of QDirIterator::next(), instead of using ::fileInfo();
using QDir::entryList instead of entryInfoList; etc.).

Leave an opt-out mechanism to ease porting.

Fix a handful of usages around qtbase, with at least a couple of them
likely to be actual "sloppy" code.

[ChangeLog][Potentially Source-Incompatible Changes][QFileInfo] Most
QFileInfo constructors are now explicit. The
QT_IMPLICIT_QFILEINFO_CONSTRUCTION macro is provided to keep old code
working.

Change-Id: Ic580e6316e67edbc840aa0c60d98c7aaabaf1af6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-15 18:30:16 +01:00
Giuseppe D'Angelo
8780fbb2eb Build Qt (and client apps using it) with /permissive-
*Not* using /permissive- exposes Qt and client apps to interesting
bugs and/or build failures, (e.g. QTBUG-87225, or
19b5520abf). We demand strict
conformance by any other compiler, it's time to demand it from
MSVC too.

The Windows headers themselves are clean starting from the
Windows Fall Creators SDK (10.0.16299.0), and moreover Qt 6 will
drop WinRT; therefore, the comment in the mkspecs does not apply
any more.

Since /permissive- implies /Zc:referenceBinding, drop that
option. The other implied options are set on MSVC < 2017,
but I leave them in to avoid tinkering with the fragile lists
of C/C++ flags.

Rename the CMake internal helper function to better describe
what it does.

Fixes: QTBUG-85633
Fixes: QTBUG-85637
Fixes: QTBUG-85635
Fixes: QTBUG-88244
Change-Id: Ie03fddb61aa066fdc14b7231c22e7108b4a02fbb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-10 20:01:49 +01:00
Assam Boudjelthia
0d6a14bbd9 Android: recommend against using ANDROID_ABIS inside the project file
Pick-to: 5.15
Task-number: QTCREATORBUG-24674
Change-Id: Iad6baa1af61d3d1a44f26cb9d51e3cb97d235707
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-11-10 13:23:09 +00:00
Michal Klocek
632da28e9c Add new way to mess up projects with QMAKE_INSTALL_REPLACE
Qmake supports currently:

 * QMAKE_PRL_INSTALL_REPLACE,
 * QMAKE_LIBTOOL_INSTALL_REPLACE
 * QMAKE_PKGCCONFIG_INSTALL_REPLACE

Introduce QMAKE_INSTALL_REPLACE, where more sed magic
can be put in action in more generic manner.

replace_foo.filename = foo.h
replace_foo.matches = /bad/looking/path/to/foo
replace_foo.replace = /awesome/looking/path/to/foo
QMAKE_INSTALL_REPLACE += replace_foo

Pick-to: 5.15
Task-number: QTBUG-87154
Change-Id: Ie43d0ab4f1d4575bbf6279eb36383f38047484d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-11-09 19:13:48 +02:00
Michal Klocek
9bade12c2c Minor refactor of installMetaFile
Move some lines into createSedArgs. This is used
in follow up patch.

Pick-to: 5.15
Task-number: QTBUG-87154
Change-Id: I226f4aad4aaf703a4726c42b40afb4bde3a9d878
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-11-09 14:52:03 +02:00
Joerg Bornemann
93ac7b9d17 qmake/vcxproj: Fix handling of extra compiler outputs
In commit 68866b1a7b we introduced a bug:
At a point where the first output of an extra compiler is extracted, we
try to evaluate the first output as qmake variable. This is as
nonsensical as it sounds and leads to malformed extra compiler output in
vcxproj files.

Pick-to: 5.15
Task-number: QTBUG-87601
Change-Id: Ib9aaf8a6eed8c69243f364554325c240d0bfc7f4
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-11-02 15:31:01 +01:00
Assam Boudjelthia
75d32a195a Android: fix documentation about ANDROID_EXTRA_LIBS
ANDROID_ABIS should be used instead of ANDROID_TARGET_ARCH.

Fixes: QTBUG-81866
Pick-to: 5.15
Change-Id: I6dc9e0cd2a19bea8864e3ab4174bd609c0aad4dc
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-11-02 15:08:35 +02:00
Paul Wicking
5c352f47b9 Add doc target for qmake
qmake currently doesn't have a doc target in CMake. In qmake builds, the
doc target is in qtbase/ (not in qtbase/qmake). This patch mimics the
mechanic used in QDoc, and adds this as a special case (as the project
file doesn't contain the doc target).

Fixes: QTBUG-87868
Change-Id: Ib1ca249465c5df2f22ba73084c680781e595c30a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-27 12:49:39 +01:00
Joerg Bornemann
f22644c5fa Make "qmake -qtconf my-qt.conf -install ..." possible
Detect the case where the first argument is -qtconf <file> and ignore
that for the -install argument.

Task-number: QTBUG-87801
Change-Id: If6822ee3ebef99de645aee8d110ebdcb13fb2da2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 21:11:50 +02:00
Joerg Bornemann
661b586a69 Make "qmake -qtconf my-qt.conf -query" possible
It's now possible to put the -qtconf argument in front of the -query
argument (and others).

Fixes: QTBUG-85136
Change-Id: I74b78f084acf264ef637ed2f6cb63b655b176056
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 21:11:46 +02:00
Friedemann Kleint
008343a05e qmake: Fix qHash-related integer conversion warnings
Use size_t instead of uint.

Change-Id: I1dc38f61653f9bfc4ddeddcc65b0271aa4ad1256
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-17 11:56:59 +02:00