Commit Graph

2080 Commits

Author SHA1 Message Date
Christian Romberg
059172c633 Fix precompiled headers for Clang
Precompiled headers were put in a directory which had exactly the same
name as the binary to be generated. This resulted in a failure with any
mkspec that used clang_pch_style. The g++-mkspec avoid this problem by
extending the directory name. This change adopts this technique for
clang mkspecs.

[ChangeLog][qmake] Fixed precompiled headers for the Clang compiler.

Fixes: QTBUG-72404
Change-Id: I471462e2bcb1e33f19d277c21acde0c04b1ffcd6
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-25 07:04:50 +00:00
Qt Forward Merge Bot
375efdd0e1 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iebedaa967a263854f18cd403ce007d7965f26d2b
2019-10-25 01:00:16 +02:00
Qt Forward Merge Bot
b327807c5e Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/io/qstandardpaths_unix.cpp
	src/corelib/tools/qsharedpointer_impl.h
	tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
2019-10-24 10:23:44 +02:00
Ulf Hermann
35adb74ddd Reimplement JSON support on top of Cbor
In turn, deprecate the QJsonDocument methods that deal with JSON binary
data. You should use CBOR for data serialization these days.

[ChangeLog][Deprecation Notice] The binary JSON representation is
deprecated. The CBOR format should be used instead.

Fixes: QTBUG-47629
Change-Id: Ic8b92ea36de87815b12307a9d8b1095f07166db8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-21 19:12:51 +02:00
Simon Hausmann
0eb4dcad89 Fix developer build with -Werror
The group parameter is only used when cross-compiling, mark it as unused
otherwise. This is noticeable in the cmake branch because there we build
qmake with cmake and apply the same warning flags, as opposed to the
bootstrapped qmake build when using ... qmake.

The cache file parameter in qmake is unused and the
mustEnsureWritability is only used on Windows.

Change-Id: I08655d5150f5a967c2340ee7678bad3a4d69914f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-15 10:46:06 +00:00
Alexandru Croitor
e919dfb91e Fix build of qmake
It was missing a source file for the QByteArrayList_join
symbol.

Change-Id: Ifcfd68d216f1e5370f90d7131bb3f7c9f91f07f3
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-10-15 08:11:13 +00:00
Joerg Bornemann
d3d5eadf24 Fix assert in VS project generator
We must check whether outputs or inputVars are non-empty before
accessing them.

This amends commit 68866b1a.

Task-number: QTBUG-79178
Change-Id: Iecf6dc705bac9bef5133ae2e5ceeace5f859f175
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-10-15 04:20:41 +00:00
Alexandru Croitor
440286655e Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
2019-10-14 17:46:34 +02:00
Alexandru Croitor
b6e75ff3ea Regenerate qtbase after wip/qt6 -> wip/cmake merge
Note that android builds will be broken after this merge and
regeneration, because we don't currently handle the minimum required
changes that were brought in with the Android multi ABI support
that comes from 5.14.

This will have to be addressed in a separate change.
For now the build on Android will fail while compiling due to incorrect
generation of LIB_SUFFIX with QT_ARCH.

Change-Id: Ia4a871f4b7ddd0da11caf5f34e10a599a97bb55d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-14 08:49:24 +00:00
Alexandru Croitor
f4b4c4f79b Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
2019-10-11 16:23:19 +02:00
Qt Forward Merge Bot
50d41f14ee Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I14f539ccfa4ab6e21188b98c314bdb030f3b9f70
2019-10-11 01:01:15 +02:00
Joerg Bornemann
472f5331ca Doc: Fix QMAKE_EXTRA_TARGETS snippet description
The snippet uses the Unix touch command, not qmake's touch function.

Change-Id: I71d1460447249b8941ce4bdbb494bb419e13b119
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-10-10 14:43:15 +02:00
Lars Knoll
e1fd607493 Remove leftovers from QML1
QML1 is not supported anymore, remove the leftover hooks for it.

Change-Id: I2900726714c5faea3523b2ebe39bb393364b3bfb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-10 11:28:19 +02:00
Tor Arne Vestbø
9115c7ae45 qmake: Avoid writing glue project file when only generating prl files
When qmake is run with -prl we don't need to write the glue makefile,
and doing so will end up with MakefileGenerator::writeProjectMakefile
trying to write to an invalid Option::output, resulting in warnings:

  QIODevice::write device not open

Change-Id: I196b185570e7329c621c2ccb8530b43f4be51ee6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-09 02:10:03 +02:00
Alexandru Croitor
cb90784eb1 Regenerate qmake and bootstrap projects
Change-Id: I6649a58752309a346bc03271f17fe80d0b727be3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-07 22:45:53 +00:00
Qt Forward Merge Bot
2c4b44d750 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ife31dad3c8dc43c5ff4d266e6d646230c5d20a50
2019-10-06 01:01:08 +02:00
Liang Qi
96a2044009 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/network/access/qnetworkaccessmanager.cpp
	src/network/access/qnetworkreplyhttpimpl.cpp

Change-Id: I059be651604623616fd31e8616be8ae61b4f8883
2019-10-04 15:27:15 +02:00
Edward Welbourne
0118e2e915 Include likely-adjusted uiLanguages for the system locale
QLocale::uiLanguages() on the system locale uses whatever the system
locale's query(QSystemLocale::UILanguages,...) returns. On Android,
this is just a list of locales. However, for non-system locales, we
also include some results of removing likely sub-tags from the locale
name, where equivalent. Thus zh-CN would also get zh and zh-Hans-CN
added to it; however, if the system locale is zh-Hans-CN, the shorter
forms are omitted. So post-process the system locale list in the same
way, albeit tweaked to avoid duplicates and rearranged so that we can
insert likely-adjusted entries between what they adjust and what
followed it.

Added QLocalePrivate::rawName() in the process, since it looks likely
to be useful in other contexts (and I needed its value): it just joins
such tags as are non-Any. This, however, uses QByteArrayList, so added
that (it's small) to the bootstrap library and qmake.

This follows up on commit 8796e3016f.

[ChangeLog][QtCore][QLocale] The system locale's UI languages list now
includes, as for that of an ordinary locale, the results of adding
likely sub-tags from each locale name, and of removing some, where
this doesn't change which locale is specified. This gives searches for
translation files a better chance of finding a suitable file.

Fixes: QTBUG-75413
Change-Id: Iaafd79aac6a0fdd5f44aed16e445e84a2267c9da
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-04 15:16:15 +02:00
Tor Arne Vestbø
3018c48f32 qmake: Parse -framework link lines the same way the linker does
[ChangeLog][qmake] The syntax 'LIBS += -frameworkFoo', or
'LIBS += "-framework Foo"' is no longer supported. Use the
canonical 'LIBS += -framework Foo' instead.

Change-Id: I50fd02dbfa155a0b95859734486a92bd448e87c2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-04 13:09:26 +00:00
Joerg Bornemann
5ab8efd66a Make conflicting targets check less strict
People tend to "turn off debug and release builds" by just not building
one of the variants. For example, Qt's own rcc is built in release only,
however it is configured for debug_and_release with the same TARGET for
both.

Let qmake complain about conflicting TARGETs only we're about to build
all of those conflicting targets, i.e. if build_all is set.

Change-Id: I0448bf5cb421e2d801d3cc30e0d80353fba0d999
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-10-03 20:28:03 +02:00
Joerg Bornemann
ce5dc31932 Fix needless resolution of -l LIBS entries on Windows
Do not resolve -l entries to absolute file paths for libraries in the
default search paths.

This restores behavior from 5.12.0 (commit 2327944d) for Windows
system libraries.

Fixes: QTBUG-78827
Change-Id: Ic2d4626df87308dd635afc1ab5c4b8191d3d2831
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-10-03 20:27:48 +02:00
Tor Arne Vestbø
74abe98320 qmake: Place prl files under Resources in framework bundles
The root of the framework bundle shouldn't contain random files,
and doing so will prevent the bundle from being signable.

We still look up prl files in the root, to keep backwards
compatibility.

Change-Id: Ifd0bc3c6e7924e89eec54d3ef9368dfc95ed402c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-03 11:11:20 +02:00
Qt Forward Merge Bot
4c8814a341 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ideaa64d583746f1ce8265997131fb1ce3a9acbcf
2019-10-02 08:39:15 +02:00
Liang Qi
99cdd5fc67 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/global/qrandom.cpp
	src/corelib/io/qfileinfo.cpp
	src/corelib/kernel/qeventdispatcher_win.cpp
	src/corelib/kernel/qeventdispatcher_win_p.h
	src/gui/text/qfontdatabase.cpp
	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
	src/plugins/platforms/windows/qwindowsglcontext.cpp
	src/testlib/qtestcase.cpp

Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4893212471aa24be804c989a581810e2f714545c
2019-09-30 14:43:02 +02:00
Joerg Bornemann
21d988a199 Doc: Document CONFIG values that are worth documenting
Fixes: QTBUG-538
Change-Id: Id06e316e7ae3d59b63b256ef565a1ad6dc5d9dd2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-09-27 15:51:25 +02:00
Qt Forward Merge Bot
f9394275f9 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ic0dbddfa711905bc8e01aa6cbbdabf056a19587f
2019-09-24 17:30:08 +02:00
Liang Qi
6572650641 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/widgets/styles/qstylesheetstyle.cpp

Change-Id: If11da7799075cc2d5768da5603c5fc46773c4eae
2019-09-23 08:35:49 +02:00
Qt Forward Merge Bot
c0f7cc3a3c Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ic274a375d6fc1312ced2354e034dc0980dd47c51
2019-09-22 22:28:33 +02:00
Leena Miettinen
51f1428d3c qmake: Replace WinRT with UWP in the qmake Manual
Remove info about Windows Phone, which is no longer supported.

Task-number: QTBUG-61884
Change-Id: Ic330f0f19a4e7314dd175f6c492fa25133185517
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-09-20 09:44:00 +02:00
Joerg Bornemann
73f880d393 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	qmake/generators/makefile.cpp
	qmake/generators/makefile.h

Change-Id: I4c2deac4f6376c85f5e4fe7fb0ccc9ab9a013cd7
2019-09-20 08:20:47 +02:00
Joerg Bornemann
90779d96ad Ignore non-existent .ui file dependencies
Commit 80dea664 broke .ui files with global includes that are not part
of the project, because we blindly added every file path that falls
out of 'uic -d' as dependency.

Introduce the extra compiler CONFIG flag dep_existing_only to bring
back the old behavior that ignores non-existent dependencies and set
it for uic.

Change-Id: I6eaa82817c932a98ebac6d08115a9815d4b9dd21
Fixes: QTBUG-78144
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-09-18 08:24:46 +02:00
Joerg Bornemann
1456b8091a Make it possible to undefine NDEBUG for nmake and VS projects
For nmake and VS projects we added the NDEBUG define for the release
configuration unconditionally within the qmake generators. To undefine
it, users had to use a nasty work-around.

Now, define NDEBUG within the MSVC mkspecs. In order to do that we
introduce the DEFINES_RELEASE and DEFINES_DEBUG variables that are
merged into DEFINES in default_pre.prf.

Users can unset NDEBUG by writing
    DEFINES -= NDEBUG
in their .pro file.

Note that DEFINES_RELEASE and DEFINES_DEBUG are merged in
default_pre.prf in order to give extra compilers (like moc) the chance
to see the fully resolved DEFINES variable. This is different from the
QMAKE_CFLAGS_(DEBUG|RELEASE) variables that get merged in default_post.prf.

Fixes: QTBUG-78071
Change-Id: I381770a1d2f974fbae9b09a2254e3f2fc7842b68
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-09-18 08:24:38 +02:00
Friedemann Kleint
d49d076431 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ic1fd51143f903b7e9086fc19ca960dfd9654ee00
2019-09-17 08:32:43 +02:00
Mårten Nordheim
2cf0ba1fba Use pre-compiled headers when building Qt with cmake
Some modules define their own manually-maintained lists, and we can rely
on the headers generated by each module to include in the pch as well
e.g. QtCore/QtCore.

There's also e.g. QtWidgetDepends for QtWidgets, but this only
works for modules, not for tools, examples or other applications.
For now we'll use the Qt<Module>/Qt<Module> headers for the
modules we depend on.

Building with PCH can be disabled with -DBUILD_WITH_PCH=NO, and it only
works for versions of CMake newer than 3.15.20190829.

Change-Id: Iae52bd69acfdfd58f4cd20d3cfa3c7f42775f732
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-11 08:25:54 +00:00
Friedemann Kleint
1d53b6d9f2 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp

Change-Id: Idd3ca5cb9a2b95a4c3513b2a4c8966e6f56193f1
2019-09-09 07:51:49 +00:00
Qt Forward Merge Bot
1f35c8caa0 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I371c5ae1af6f58e32e579671f485b92b586e0b76
2019-09-08 11:33:28 +02:00
Alexandru Croitor
4ac872639e Make Qt relocatable
[ChangeLog][QtCore] Qt installations on the host system can now be
relocated, i.e. moved to other directories.

Add a new feature 'relocatable' that's by default enabled for
non-static builds
  - on platforms where libdl is available,
  - on macOS when configured with -framework,
  - on Windows.

If the feature is enabled, the directory where plugins, translations
and other assets are loaded from is determined by the location of
libQt5Core.so and the lib dir (bin dir on Windows) relative to the
prefix.

For static builds, the feature 'relocatable' is off by default. It can
be turned on manually by passing -feature-relocatable to configure. In
that case, QLibraryInfo::location(QLibraryInfo::TranslationsPaths) and
friends will return paths rooted in the user application's directory.

The installed and relocated qmake determines properties like
QT_INSTALL_PREFIX and QT_HOST_PREFIX from the location of the qmake
executable and the host bin dir relative to the host prefix. This is
now always done, independent of the 'relocatable' feature.

Note that qmake is currently only relocatable within an environment
that has the same layout as the original build machine due to absolute
paths to the original prefix in .prl, .pc and .la files.
This will be addressed in a separate patch.

Task-number: QTBUG-15234
Change-Id: I7319e2856d8fe17f277082d71216442f52580633
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-07 20:02:45 +02:00
Qt Forward Merge Bot
a9db729095 Merge remote-tracking branch 'origin/5.12.5' into 5.12
Change-Id: I41a252fdbf22551aadb0b1a6e9ecf3f95f99fbd4
2019-09-07 13:08:26 +02:00
Qt Forward Merge Bot
caf123a288 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ib6649a412e131bf679aab97c4c384520af348b4f
2019-09-06 09:44:10 +02:00
Qt Forward Merge Bot
fa2589bbb5 Merge remote-tracking branch 'origin/5.13.1' into 5.13
Change-Id: Ic633850940bbe17dcedc1609217a052b6f81ce4b
2019-09-05 13:33:00 +02:00
Liang Qi
6a36fe904c Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/codecs/qicucodec.cpp
	src/dbus/qdbusserver.cpp
	src/gui/painting/qbezier.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
	src/plugins/printsupport/cups/qppdprintdevice.cpp

Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
2019-09-04 07:03:54 +02:00
Joerg Bornemann
abfb1b8665 Don't add default lib dirs to LIBRARY_SEARCH_PATHS in xcode projects
Having hard-coded absolute paths in the xcode project breaks switching
between iOS and simulator builds.

Fixes: QTBUG-77804
Change-Id: Ib655bfc774b92c413a7b94ba4d005b6e1c4d2905
(cherry picked from commit 97465b1540)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-03 20:52:35 +02:00
Joerg Bornemann
7b82d27429 Fix library suffix replacement for xcode projects
In xcode projects we replace the _debug part of referenced libraries with the
variable $(QT_LIBRARY_SUFFIX). This only worked for libraries passed with -l.

Make the library suffix replacement work for libraries passed as absolute paths
too.

Fixes: QTBUG-77804
Change-Id: Iac2dbd2f67c3fa0f415ac43cbab5a906657164e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-31 07:56:54 +00:00
Joerg Bornemann
11206b5340 Remove QMakeLocalFileName::is_null
This is never different from real_name.isNull().

Change-Id: Ic1442f2eec4d7dfb2d3694e85d664f1509d4b68b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-30 12:30:26 +02:00
Joerg Bornemann
ea1c8d4e65 Remove nonsensical initialization from QMakeLocalFileName
The c'tor that takes a QString detects whether the string's first and
*last but one* characters are double quotes. In that case it removes
the first and *last* characters, resulting in a conversion from
"\"C:\\foo\"\\" to "C:\\foo\"". It's highly unlikely that this code path
was ever triggered, because its erroneous result would have been
noticed. Remove it.

Change-Id: I653e6a4667ae3620c35e509420eb22a71bb986a9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-29 14:02:48 +00:00
Joerg Bornemann
fc6d569862 Do not prepend QMAKE_PREFIX_STATICLIB to TARGET for TEMPLATE aux
This was introduced by accident in 4da47d0f.

Fixes: QTBUG-77429
Change-Id: Ic3d9052e1fc83dab5ed3b8725629588208b0d7bb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 2a4cf923f4)
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-28 06:25:01 +00:00
Joerg Bornemann
97465b1540 Don't add default lib dirs to LIBRARY_SEARCH_PATHS in xcode projects
Having hard-coded absolute paths in the xcode project breaks switching
between iOS and simulator builds.

Fixes: QTBUG-77804
Change-Id: Ib655bfc774b92c413a7b94ba4d005b6e1c4d2905
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-27 21:59:00 +02:00
Allan Sandfeld Jensen
afac8dac58 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/gui/painting/qdrawhelper.cpp
	src/gui/painting/qdrawhelper_p.h
	src/gui/painting/qdrawhelper_sse2.cpp
	src/gui/painting/qdrawhelper_x86_p.h

Change-Id: I83256bb38ab3a705776e353bc0629315b6c59a0f
2019-08-27 13:08:38 +02:00
Liang Qi
0f1f7fb97f Merge remote-tracking branch 'origin/dev' into 5.14
Conflicts:
	src/widgets/kernel/qwidget.cpp
	src/widgets/kernel/qwidget_p.h
	src/widgets/kernel/qwidgetrepaintmanager.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
2019-08-27 09:45:52 +02:00
Joerg Bornemann
09bfc52dde Remove broken wild card list from QMake's help output
The description of the project mode looked like this:

  -project       Put qmake into project file generation mode
                 In this mode qmake interprets files as files to
                 be built,
                 defaults to *; *; *; *.ts; *.xlf; *.qrc

The list of wildcards is incomplete. Unfortunately the file extensions
are defined in QMAKE_EXT_* variables in mkspecs, and the help display
code has no access to that data. This went unnoticed for quite some
time, and fixing this is too involved considering the gain.

Replace the text above with the static text below:

  -project       Put qmake into project file generation mode
                 In this mode qmake interprets [files] as files to
                 be added to the .pro file. By default, all files with
                 known source extensions are added.

Change-Id: I815a50957c05dccc45e1cd6657f568599d1911f6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-24 09:18:02 +02:00
Joerg Bornemann
92f4523c8a Fix classical strcmp misuse in VS project generator
The conditions were wrong, they must compare against zero.
Also, use qstricmp to avoid the platform #ifdef.

Change-Id: I7e5ef1b9ae8e2e1d3d9ce90a645ee568b370ab57
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-24 00:28:43 +02:00
Joerg Bornemann
f65cfadd04 Improve readability of commands in VS project files
The commands are separated by "if errorlevel 1 goto VCEnd" lines to
make sure we abort on the first failure. However, we also insert magic
comments starting with "Rem" for IncrediBuild. These do not need
error checking. Also, the last command does not need error checking.

The XML line ending entities are also unneeded. By using proper line
endings we ensure that commands appear on separate lines in Visual
Studio's property editor.

Change-Id: Ifbf7525281e892c820034fafc64b555fff3dc756
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
2019-08-22 18:15:08 +02:00
Joerg Bornemann
9db230efa9 Fix "conflicting targets" warning when generating VS projects
The VS project generator never calls the Win32MakefileGenerator code
that sets up DEST_TARGET which is used for checking for conflicting
DESTDIR/TARGET combinations on Windows. Replicate the setup in
VcprojGenerator::initProject().

This amends commit e75aed1a.

Change-Id: I4238eb2f57615095c372cee9ada9fc961cc36133
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-22 11:21:31 +02:00
Joerg Bornemann
1d89748772 Fix .sln generation for sub-projects with same TARGET
Sub-projects in VS solutions must have unique project names. If there
are multiple projects with the same TARGET then QMAKE_PROJECT_NAME must
be set to different values.

The .sln generation code did not use QMAKE_PROJECT_NAME and produced
.sln files with equally named sub-projects.

Replace the 'orig_target' member of VcsolutionDepend with a
'projectName' member and use it when writing the .sln file and for the
misnamed "GUID map" that's supposed to have unique keys.

This commit amends 9e750d34 (qt/qt.git).

Fixes: QTBUG-77639
Change-Id: I81c64f8bc6baeb6d99e9d5808fb73dfd7aaaeeb8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-20 20:28:18 +02:00
Joerg Bornemann
3b5f9678d7 Remove dead QMakeSourceFileInfo caching feature from QMake
Since its introduction in commit
65bb1a25419210e6097cad973fb847aa3719c09b (old internal history, 2005)
with the commit message "optimizations I've been sitting on here"
we're dragging along this dead code. It is time for removal.

Change-Id: Ic7902ebb8c402734974ad6651a1371d1e5bf93c5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-20 20:27:52 +02:00
Soroush Rabiei
aa8393c94f Add support for calendars beside Gregorian
Add QCalendarBackend as a base class for calendar implementations and
QCalendar as a facade via which to access it.

QDate's implicit implementation of the Gregorian calendar becomes
QGregorianCalendar and QDate methods now support choice of calendar.

Convert QLocale's CLDR data for month names to a locale-data component
of each supported calendar and relevant QLocale methods now support
choice of calendar. Adapt Python scripts for locale data generation to
extract month name data from CLDR (keeping on version v35.1) into the
new calendar-locale files. The locale data for the Gregorian calendar
is held in a Roman calendar base, for sharing with other calendars.

Add tests for basic uses of the new API.

[ChangeLog][QtCore][QCalendar] Added QCalendar to support diverse
calendars, supported by implementing QCalendarBackend.

[ChangeLog][QtCore][QDate] Allow choice of calendar in various
operations, with Gregorian remaining the default.

Done-with: Lars Knoll <lars.knoll@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-17110
Fixes: QTBUG-950
Change-Id: I9d6278f394269a183aee8156e990cec4d5198ab8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-20 13:41:21 +02:00
Paul Olav Tvete
2f52e1da0d Merge remote-tracking branch 'qt/5.12' into 5.13
Conflicts:
	src/gui/configure.json
	src/gui/util/qtexturefilereader.cpp
	src/gui/util/util.pri
	tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp

Change-Id: I2bc4f84705b66099e97330cda68e0b816aceb9cc
2019-08-20 10:41:56 +00:00
Qt Forward Merge Bot
56f46ba13d Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ia3645f92b9debf3e1fe2d972300c7d0dbd649268
2019-08-16 01:00:33 +02:00
Alexandru Croitor
c7ec7cd2a1 Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
2019-08-15 16:53:19 +02:00
Joerg Bornemann
31e0d171d6 Fix qinstall on Windows for directories containing read-only files
Initial patch by: Vlad Lipskiy <eswcvlad@yahoo.com>

Fixes: QTBUG-77299
Change-Id: I803b809d1f23d844252b701cb070f6e4ba34eca1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-15 09:24:14 +02:00
Qt Forward Merge Bot
c5c9380555 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Id7954ada1f8658d3b1da5e8241a09f2d201a7c56
2019-08-15 01:00:30 +02:00
Joerg Bornemann
2a4cf923f4 Do not prepend QMAKE_PREFIX_STATICLIB to TARGET for TEMPLATE aux
This was introduced by accident in 4da47d0f.

Fixes: QTBUG-77429
Change-Id: Ic3d9052e1fc83dab5ed3b8725629588208b0d7bb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-14 11:04:06 +02:00
Liang Qi
275ad4ce4c Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-08-13 10:20:13 +02:00
Liang Qi
1dade1bd8a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	mkspecs/win32-clang-msvc/qmake.conf
	src/corelib/tools/qlist.h
	src/gui/painting/qcompositionfunctions.cpp
	src/gui/painting/qtriangulator_p.h
	src/gui/text/qfontengine_p.h
	src/network/kernel/qhostinfo_p.h
	src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp

Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
2019-08-13 09:46:17 +02:00
Joerg Bornemann
42d32e468a Determine dependencies of Windows resource files
Windows resource files support a subset of C preprocessor directives.
Among others they can have #include directives.

Use QMake's own scanner to retrieve the files that are included by a
Windows resource file and add them to its dependencies.

For the test case the TestCompiler class had to be extended:
runCommand is now public, and commandOutput is less peculiar.

Fixes: QTBUG-3859
Change-Id: I138703352c37c98297c0574a9a440510c1c494b8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-13 09:38:46 +02:00
Joerg Bornemann
7f4f346e51 Fix escaping of < and > in QMake's XML generator
Having those characters in QMAKE_EXTRA_COMPILERS broke the generated
VS project file. They must be replaced by XML entities.

Fixes: QTBUG-1935
Change-Id: Iff1edbeabec4cedef777071682412970b7769f19
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-08-12 14:46:20 +02:00
Liang Qi
44c393f9b6 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	config.tests/arch/write_info.pri
		Repair architecture config test for the WASM_OBJECT_FILES=1 build mode
	configure.pri
	tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp

Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
2019-08-12 13:23:11 +02:00
Joerg Bornemann
50e496bd3a Do not use QList<QMakeLocalFileName>
QMakeLocalFileName is not suitable for QList. Use QVector instead.

Change-Id: I5a3c4c8da14c0a920b5a57cba148ad68ac0f85a2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-12 08:05:14 +02:00
Joerg Bornemann
e66f247ccf Doc: Extend QMake's documentation of RC_FILE and RES_FILE
RC_FILE is not an internal variable that "rarely needs to be
modified". Mention that it's about Windows resources and link to the
corresponding section.

RES_FILE: Add link to RC_FILE and the more general section. Also
rephrase "compiled Windows resource file" to "Windows resource
compiler's output file" which is more precise.

Fixes: QTBUG-8709
Change-Id: I19c61e6a9505d45fc13fefbcd0ba9441191aa42e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com>
2019-08-12 08:04:39 +02:00
Joerg Bornemann
e75aed1a96 Warn about conflicting DESTDIR/TARGET combination in debug_and_release
If a project has DESTDIR and TARGET set to fixed values, then the
target paths conflict when doing debug_and_release builds.

With this change we're detecting this situation and yield a warning.

Fixes: QTBUG-2736
Change-Id: Ib163db3463322792ab9fa5b997285ac9fc9819ab
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-09 10:29:28 +02:00
Joerg Bornemann
ee8509d6cb QMakeLocalFileName: remove mutable specifier from real_name
There is no need to have both QString member mutable.

Change-Id: I592963b7c66e564b918d750fb47e903df0b0f9bc
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-08 17:05:19 +02:00
Liang Qi
f3b28e8021 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	qmake/generators/unix/unixmake2.cpp
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
2019-08-05 09:28:48 +02:00
Joerg Bornemann
8c0787cfa1 Fix dependency_libs entry of .la files
Libtool cannot cope with absolute paths in the dependency_libs entry.
We split absolute paths into -L and -l here.

Change-Id: I30bf11e490d1993d2a4d88c114e07bbae12def6d
Fixes: QTBUG-76625
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-03 21:47:55 +02:00
Joerg Bornemann
49a8aae6d3 Remove special handling of DLLDESTDIR on Windows
In MakefileGenerator::initOutPaths() we ensure that directory
variables end with a directory separator, except for DLLDESTDIR.
There doesn't seem to be a valid reason for this exception.
Remove it for the sake of simplifying the code base.

Change-Id: I60eb01b410161e6e1d147d76f044f5140a7573bd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-03 12:48:29 +00:00
Joerg Bornemann
a3de48eccc Remove QMake's -createstub option
This undocumented option was introduced in
69c22301806b56d56cbe5f5076b889ba98e41a2b (old internal history, 2006) to
prepare some unspecified change to configure that was never done.

Change-Id: I60de731ac9bc6f6424c57574e59e9f6b4f6c5eb3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-03 14:48:10 +02:00
Joerg Bornemann
97d6517114 Fix Makefile re-generation for debug_and_release builds
Re-generation of the Makefile depends on a correctly set up
QMAKE_INTERNAL_INCLUDED_FILES variable. In debug_and_release builds
this variable is set up for Makefile.Debug and Makefile.Release, but
not for the meta Makefile. However, that's where the Makefile
re-generation target is located.

We now collect the contents of QMAKE_INTERNAL_INCLUDED_FILES for
Makefile.Debug/Release and use that for the meta Makefile.

Fixes: QTBUG-13334
Change-Id: I6124a91447d5c54d51680e23570c4e97f44e6a73
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-02 08:06:44 +02:00
Joerg Bornemann
f84ea9a6bd Rename MakefileGenerator::build_args() to ...::fullBuildArgs()
...because
  - it calls the properly camel-cased member function buildArgs(bool),
    which is slightly confusing
  - it returns buildArgs(true) plus input and output

We also let it return only the arguments, excluding the qmake
executable. This is consistent with the function's name and saves us a
string replacement stunt at one call site.

Change-Id: I8bea65900bd51962962e4cfd425ffbc26e3a52fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-31 09:04:34 +02:00
Joerg Bornemann
7adc1d329f Remove dead code from metamakefile.cpp
Remove usage of the 'if (0 && ...)' pattern that was presumably used
to temporarily disable code paths. The disabling of the two code paths
was introduced in 356a677b386648710efc4db9a8a1b4a975f95c48 (old
internal history, 2004) and
0326e3511928d90329152b9b0493da76e9caa442 (old internal history, 2006).
It can be deduced that it's pretty safe to remove both.

Change-Id: I88aee65b1286701241b5b80fbac0c65cd99ecd5e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-31 09:04:30 +02:00
Liang Qi
71ec1d6d79 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	qmake/generators/win32/mingw_make.cpp

Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
2019-07-30 13:47:36 +02:00
Qt Forward Merge Bot
409cc99896 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ibdbd88e11cd03d5ce558e67ad8e9a21436e7ef89
2019-07-30 01:00:19 +02:00
Tor Arne Vestbø
c2f041203f qmake: Keep -force_load with library when merging linker flags
Without treating -force_load as an option with an argument, we end up
leaving stray -force_loads in the linker line, resulting in build
failures when the following option is a random library then treated
as a file path.

Task-number: QTBUG-66091
Change-Id: I352c50ab67e32ef6b2b5c6a4f90455b20034e207
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-29 17:23:16 +02:00
Tor Arne Vestbø
080fbb55b5 qmake: Don't allow -framework without second argument when merging flags
The linker doesn't support -framworkFoo, so neither should we. The correct
syntax is -framework Foo.

Change-Id: I3f39ffc067871ce058542bf0068274b35f7b51f6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-29 17:20:10 +02:00
Orgad Shaneh
1061103890 qmake: Use a simple response file for ar on mingw
This change allows using custom flags for ar. For instance, it is
now possible to create a thin archive by setting QMAKE_LIB += -T.

This uses and extends commit d92c25b1b4
which served a similar purpose for the linker.

Change-Id: Ie1d6a0b957dc4809957726de00911c8d91647fab
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-29 08:41:27 +00:00
Liang Qi
261a87f956 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	qmake/generators/makefile.cpp

Change-Id: Ib3715e626f2fd32804c75c16ea9aa06a1216e76d
2019-07-22 06:50:42 +02:00
Qt Forward Merge Bot
124b5b8108 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ic34021fbb87d689ee23a5d1b3f50617ada9ec9b9
2019-07-20 01:00:13 +02:00
Yulong Bai
a96a64be2d qmake: fix variable naming conflicts with C++20 keyword
It conflicts with 'requires' keyword.

Fixes: QTBUG-77093
Change-Id: I85e8f530dd1e2bf9a31906dd6c5123b947235b01
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-19 21:31:50 +02:00
Giuseppe D'Angelo
907923b7ca qmake: fix move semantics
ProFunctionDef is move-enabled, meaning its `m_pro` field can
become nullptr. Its usage in the assignment operator and the dtor
must therefore be protected with a check.

Amends 9c63ad562b.

Change-Id: I0c77b07dc83969565480bbb9d9fc80751d4246b1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-18 12:55:33 +00:00
Qt Forward Merge Bot
64df0eda36 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/global/qlogging.cpp
	src/gui/painting/qtextureglyphcache_p.h
	src/gui/text/qfontengine.cpp
	src/widgets/widgets/qlineedit.cpp

Change-Id: Ic8798538df466b7141caa8bbf1fb7605eb56be37
2019-07-17 10:44:21 +02:00
Marc Mutz
efa183309e QMake: fix GCC 9 -Wdeprecated-copy warnings
Not visible in QMake, because of too old C++ standard used to compile it,
but in the qttools copy. Fix here, as the authorative source, first.

Change-Id: I2552eccfaab2cef0863686dcd888f2a5f25ca29f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-15 12:11:31 +02:00
Marc Mutz
0ca7c0a575 QMake: be less laissez-faire with implicit conversions to QChar
QChar currently is convertible from nearly every integral type. This
is bad code hygiene and should be fixed come Qt 6.

The present patch is the result of compile fixes from marking these
constructors explicit.

Amends 60ca2f5f7c.

Change-Id: I06887104d42f8327eb6196afcde5f942a74a6a78
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-15 10:56:00 +02:00
Qt Forward Merge Bot
77d126ccb5 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	configure.pri

Also required s/solid\.color/solidColor/ in a couple of places in:
	src/gui/painting/qpaintengine_raster.cpp

Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
2019-07-12 12:23:29 +02:00
Alexandru Croitor
4dac45c9ee Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
2019-07-11 17:17:51 +02:00
Edward Welbourne
a9aa206b7b Move text-related code out of corelib/tools/ to corelib/text/
This includes byte array, string, char, unicode, locale, collation and
regular expressions.

Change-Id: I8b125fa52c8c513eb57a0f1298b91910e5a0d786
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-10 17:05:30 +02:00
Liang Qi
deee7b7ece Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	qmake/generators/makefile.cpp

Change-Id: Ifb2633a69d0bf8cdf12d799c6259beefc279c49e
2019-07-05 15:37:50 +02:00
Alexandru Croitor
6ad08b9cad CMake: Fix handling of static dependencies that have spaces in path
The absolute paths of certain static dependencies can have spaces in
them. The _qt5_$${CMAKE_MODULE_NAME}_process_prl_file fails to handle
this, and simply replaces all spaces with semicolons, which obviously
breaks the list of dependencies, and a consuming application fails to
link with a message like:

LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'

This change partially restores the functionality that was added in
102e1822ff specifically the part
that changes qmake to export an additional variable
QMAKE_PRL_LIBS_FOR_CMAKE. This variable has the same content as
QMAKE_PRL_LIBS except it uses a semicolon as a separator, so that
CMake can correctly parse the separate lib entries.

This is much cleaner than trying to parse the original QMAKE_PRL_LIBS
variable with a complicated regular expression.

Amends eda28621f6.

Task-number: QTBUG-38913
Change-Id: I1d18fb779606505bc92320d8ce13232c7022e212
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-05 10:18:56 +02:00
Jörg Bornemann
adaa997ce6 Revert "Fix determination of source and build roots"
This reverts commit 224a60989e.

Turns out that we cannot just untangle the determination of
source root and build root, because this breaks the assumption
that every .qmake.conf results in a separate .qmake.cache in the
build tree. QTBUG-76140 must be fixed differently.

Fixes: QTBUG-76907
Change-Id: I5c0a3719d5e00a0f1cacad51651b47c1f284d22d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-04 19:44:52 +00:00
Joerg Bornemann
2f672b2239 Do not ignore exit codes when installing meta files
Since commit 20e9422e we don't ignore exit codes when installing files
anymore. This patch does the same for meta file installation. We
really should be notified properly if something goes wrong here.

Task-number: QTBUG-18870
Change-Id: Ib6a20293380f400379b10ec767bf38dc74d5beeb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-01 17:39:59 +02:00
Giuseppe D'Angelo
f66c1db16c Introduce Q_NAMESPACE_EXPORT
A recurring problem with the Q_NAMESPACE macro is that it declares
an object (staticMetaObject) in the surrounding namespace. That
object lacks any export/import qualification to make it usable
with shared libraries.

Introduce therefore another macro to work around this issue, allowing
the user to prefix the object with an exporting macro, f.i. like this:

Q_NAMESPACE_EXPORT(Q_CORE_EXPORT)

The old macro can simply then be rewritten in terms of this new one,
supplying an empty export macro.

Note that NOT passing an argument to a macro expecting one is well
defined behavior in C99 -- the macro will expand an empty token.
Of course, MSVC doesn't like this and emits warnings. As a
workaround, use a variadic macro.

[ChangeLog][QtCore] Added the new Q_NAMESPACE_EXPORT macro. It
can be used just like Q_NAMESPACE to add meta-object information
to a namespace; however it also supports exporting of such
information from shared libraries.

[ChangeLog][Potentially Source-Incompatible Changes] Prefixing
Q_NAMESPACE with an export macro may no longer work. Use the new
Q_NAMESPACE_EXPORT macro for that use case.

Fixes: QTBUG-68014
Change-Id: Ib044a555ace1f77ae8e0244d824ec473550f3d8e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-28 06:47:29 +02:00
Liang Qi
25eb97d2d4 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	src/network/ssl/qsslsocket_openssl.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
2019-06-27 14:38:03 +02:00
Simon Hausmann
a39a0e5419 Fix build of modules outside of QtBase when cross-compiling
The Qt::Platform target includes the mkspecs/$spec directory, which we
must unconditionally install as long as we use it.

Change-Id: I272650a887b5b0b3bd868524784dca65b76b02d9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-06-24 14:23:22 +00:00
Liang Qi
aedc59b1c3 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/io/qstorageinfo_unix.cpp
	src/network/ssl/qsslsocket_openssl.cpp

Change-Id: Ibc9ce799bef62d60d616beaa9fbde8ebeadfbc20
2019-06-25 15:47:42 +02:00
Joerg Bornemann
f6db25962e Add QDebug streaming operator for ProString
This saves us lots of .toQString() and .toQStringList() typing when
qDebug()'ing qmake code.

Change-Id: I037e5e1816f2dcb6a20dec4c275f3d886f155ad5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 17:40:07 +02:00
Joerg Bornemann
3a806254fe Fix 'clean' target for MinGW DLLs
'make clean' removed the import libs for DLLs which makes them quite
unusable. Move the import lib removal to the 'distclean' target.

Fixes: QTBUG-51977
Change-Id: I727d520435f88a83a7fb14cb0ad81f8fe7c6d61b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 17:18:20 +02:00
Alexandru Croitor
fe3bd212fc Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
This changes many different CMake places to mention Qt6 instead of
Qt5.

Note that some old qt5 cmake config files in corelib are probably not
needed anymore, but I still renamed and kept them for now.

Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
2019-06-14 16:31:09 +02:00
Alexandru Croitor
72066a3a58 Revert "cmake: Make CMake superbuilds work"
Builds fail on Windows, due to splitting on ':' on absolute file paths,
when handling syncqt injections.

Revert for now to get qt6 merge in faster.

This reverts commit 7559d508d1.

Change-Id: If139a8a1eb4ae7ccc8d7b835b12e83b03176e28b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-06-14 14:27:24 +00:00
Kevin Funk
7559d508d1 cmake: Make CMake superbuilds work
In case of a CMake superbuild, the actual install root in a non-prefix
build is the top-level build directory (not $TOP_BUILDDIR/qtbase anymore).
This is more in line how CMake lays out things by default.

Task-number: QTBUG-75582
Change-Id: I4e1744b5c877508fedc33e237eec28cb7436010b
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-14 10:16:40 +00:00
Alexandru Croitor
bb959af00a Automatically find apple frameworks when building a repo
Instead of doing it just in qtbase/src, we need to do it
for all repos before building ./src.

Change-Id: I57f226b849cd5370ffbbbea8a694697d400957a4
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-06-13 14:25:02 +00:00
Giuseppe D'Angelo
3e75c2965c Remove QLatin1Literal usages
That's an undocumented Qt 4/3/2 remnant, start remove usages.

Fix incorrect include header in qclass_lib_map.h as a drive-by.

Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 16:50:31 +00:00
Albert Astals Cid
5fea9f8f52 cmake: Add warnings_are_errors option
for modules, plugins and tools only (i.e. no tests nor examples)
this mimics the qmake behavior

default value is developer_build

Comes with some fixes in qmake since it seems in the qmake built it was
not having Werror, now does because we built it with add_qt_tool

Change-Id: I6f3237f25a6fedefa958644929e90f13837a12df
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-05 13:10:16 +00:00
Alexandru Croitor
5591e82135 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ide5b3408bfefca410323cf26b810b44c06d3a227
2019-06-03 15:51:20 +02:00
Alexandru Croitor
e4079eca49 Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.

Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
2019-06-03 15:14:42 +02:00
Christian Kandeler
feb06decfe qmake: Let evaluateFunction() return error for infinite recursion
Otherwise, it can happen that parsing goes on forever in cumulative
mode.

Task-number: QTCREATORBUG-17656
Change-Id: If69f2265ac7eee0d230bd77a9aa9500e97ebeff6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-18 11:23:03 +02:00
Joerg Bornemann
f239cd5797 Remove unneeded qstring_compat.cpp from the qmake build
Change-Id: Ie25aca49e8ff6a7aeb50dd77c36e5e1391d9c00e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-29 14:00:05 +02:00
Joerg Bornemann
af7e0e7357 De-duplicate code for calling extra compiler depend_command
Flesh out copy-and-pasted code into a function and adjust the coding
style on the go.

Change-Id: I9b8a87d6dd5c33cc1ed9f613fe85daca52309369
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 11:06:10 +02:00
Edward Welbourne
548513a4bd Separate out the time, zone, date code from corelib/tools/
We'll be adding calendar code here as well, and tools/ was getting
rather crowded, so it looks like time to move out a reasonably
coherent sub-bundle of it all.

Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-06 15:54:32 +02:00
Joerg Bornemann
57f38bc49d Do not "fixify" the content of extra compiler input variables twice
MakefileGenerator::initOutPaths should only do that: init out paths.
It's not supposed to modify the content of input variables for extra
compilers. Those get "fixed" in MakefileGenerator::init below the "do
the path fixifying" comment.

The first "fixifying" would turn an absolute path in SOURCES (input
variable for the moc_source extra compiler) into a path relative to
the output directory. The second "fixifying" would mess everything up.

Fixes: QTBUG-76097
Change-Id: I8c50ef33d097dba4a1db76144c70b0677beffb6c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-06-04 15:02:53 +02:00
Joerg Bornemann
9f77c91522 Sequentialize install targets in debug_and_release builds
Debug/release install targets can potentially install the same files which
leads to errors on install when running make with -j > 1.

If build_all is set, make the 'install' dependent of the new target
'debug-release-install' which contains the commands of 'debug-install' and
'release-install'.

Of course, debug/release is not hard-coded, but the content of the BUILDS
variable is used.

Change-Id: I67b504a95b83daf43bc89dcc0e3391b67e19c027
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-24 11:34:32 +02:00
Alexandru Croitor
c7fd10a022 Allow building the tests directory as a standalone CMake project
At the moment, Coin builds tests as a separate qmake invocation
against an installed Qt. We need to support the same with CMake.

Change the tests subdirectory to be a standalone CMake project when
CMake does not detect an existing QtTest target while processing the
subdirectory. If the target exists, it means we are building the whole
repo, if the target does not exist, we need to call find_package
to find the installed Qt.

Refactor and move around a few things to make standalone tests build
successfully:
- add a new macro to set up paths to find QtSetup
- add a new macro to find all macOS frameworks
- add a new macro to set up building tests
- add a new macro that actually builds the tests
- export the INSTALL_CMAKE_NAMESPACE value into the BuildInternals
  Config file
- export the CMAKE_BUILD_TYPE value, because a test project doesn't
  have a .git subdir and thus defaults to be built in Release
  mode, even though qtbase might have been built in Debug, so to
  avoid the mixing, the propagate the build type
- stop overriding INSTALL_CMAKE_NAMESPACE and
  QT_CMAKE_EXPORT_NAMESPACE inside QtSetup if they are set, because
  the tests project doesn't specify a major version, and if we
  override the values, the moc / uic targets don't get the correct
  major version prefix and configuration fails

Change-Id: Ibdb03687302567fe325a15f6d1cb922c76240675
Fixes: QTBUG-75090
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-22 11:12:54 +00:00
Friedemann Kleint
518cf3312c Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ia279fc4a8226626041c772902a07b2f90f37b53b
2019-05-27 15:34:10 +02:00
Friedemann Kleint
761b71bd20 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iaf6bd52972b562b9c91d9e93a988d26b0eb9d3b4
2019-05-27 09:17:14 +02:00
Edward Welbourne
14aa1f7d6f Use appropriate encoding rather than UTF-8 when reading from a pipe
The qmake code to read output from dependency-generation was adding
QByteArray values to a QString, thereby tacitly converting from UTF-8;
this is misguided. Hopefully, the command emits its output in the same
local 8-bit encoding that QString knows to convert from.

Simplified needlessly verbose loops (that violated Qt coding style) in
the process.

Fixes: QTBUG-75904
Change-Id: I27cf81ffcb63ebc999b8e4fc57abdb9a68c4d2b3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-05-24 16:58:04 +02:00
Alexandru Croitor
02a015375a Implement developer / non-prefix builds
A non-prefix build is a build where you don't have to run
make install.

To do a non-prefix build, pass -DFEATURE_developer_build=ON when
invoking CMake on qtbase. Note that this of course also enables
developer build features (private tests, etc).

When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable
will point to the qtbase build directory.

Tests can be run without installing Qt (QPA plugins are picked up from
the build dir).

This patch stops installation of any files by forcing the
make "install" target be a no-op.

When invoking cmake on the qtsvg module (or any other module),
the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build
directory.

The developer-build feature is propagated via the QtCore Config file,
so that when building other modules, you don't have to specify it
on the command line again.

As a result of the change, all libraries, plugins, tools, include dirs,
CMake Config files, CMake Targets files, Macro files, etc,
will be placed in the qtbase build directory, mimicking the file layout
of an installed Qt file layout.

Only examples and tests are kept in the separate module build
directories, which is equivalent to how qmake does it.

The following global variables contain paths for the
appropriate prefix or non prefix builds:
QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR,
QT_CONFIG_INSTALL_DIR. These should be used by developers
when deciding where files should be placed.

All usages of install() are replaced by qt_install(), which has some
additional logic on how to handle associationg of CMake targets to
export names.

When installing files, some consideration should be taken if
qt_copy_or_install() needs to be used instead of qt_install(),
which takes care of copying files from the source dir to the build dir
when doing non-prefix builds.

Tested with qtbase and qtsvg, developer builds, non-developer builds
and static developer builds on Windows, Linux and macOS.

Task-number: QTBUG-75581
Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-15 11:31:31 +00:00
Kavindra Palaraja
704b6bac13 doc: Explain how qmake finds for files included in your source code
Task-number: QTBUG-26651
Change-Id: Icc09e3272fcec8af0c33d79655159d13183c66ce
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-16 13:06:52 +00:00
Joerg Bornemann
871b65ab10 Add the c++latest CONFIG value to select the latest C++ standard
[ChangeLog][qmake] The CONFIG value c++latest was added to select the
latest C++ standard the currently used toolchain supports.

Task-number: QTBUG-75653
Change-Id: I22ddc9d293109d99e652b7ccb19d7226fca4716d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 08:01:40 +00:00
Qt Forward Merge Bot
e56d3b03ed Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/tools/qlocale_data_p.h
        (Regenerated by running the scripts in util/local_database/)
	src/gui/opengl/qopengltextureuploader.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
2019-05-09 13:06:11 +00:00
Joerg Bornemann
2a79af6b5c Doc: Document the c++2a CONFIG value
Change-Id: Ia4d84ac141b6fb27b244dfb8272b8039e337a9e4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-08 13:42:28 +00:00
Marc Mutz
4b09d5a78d qmake: remove use of Java-style iterators
They will be deprecated, so qmake wouldn't compile anymore.

Change-Id: I42212fdf213df696d736ed34458f7e79bd902dd5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-05-21 08:58:35 +02:00
Kai Koehne
99b1719c1e qmake: Document DESTDIR deficiencies
Fixes: QTBUG-75261
Change-Id: I8d0635a914785171cdee1bf691f773d4c356c6c1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-05-08 08:07:12 +00:00
Matthias Doerfel
f6238e2d3b qmake: Distinguish local header files by directory and name
Information about header files is cached by qmake. The key is the
filename of the #include directive. For system includes (<stdio.h>) this
is unique, according to the search order in INCLUDE_PATH.

For local includes, given as "foo.h", there may be name collisions. Usually a
compiler first searches in the directory of the current file (stored in the
sourceDir variable), and only in case of a miss the INCLUDE_PATH is
considered.

The dependency generation now distinguishes local header files by their full
relative path. This is implemented by forcing the use of the full relative
path as key into the SourceFiles data structure if the flag try_local is set.

Change-Id: Ifd75325b53496824054595f7fc98d71bbd9d8aa6
Fixes: QTBUG-72383
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-07 08:41:09 +00:00
Alexandru Croitor
42d3b21c92 Export tool config and target files for each relevant module
CMake will now generate config and target files for each module that
provides tools. As a result, namespaced global targets such as
Qt5::moc or Qt5::rcc can be made available.

Third party projects that require just these tools, and not the Qt
modules themselves,  should specify CMAKE_PREFIX_PATH pointing to the
installed Qt location, and call find_package(Qt5CoreTools),
find_package(Qt5GuiTools), etc.

It is also possible to call
find_package(Qt5Tools REQUIRED Core Widgets) where the last option
is a list of modules whose tools should be imported.

Note that all the tools are in the Qt5::
namespace and not in the Qt5CoreTools:: or Qt5WidgetsTools::
namespace.

This commit also changes the behavior regarding when to build tools
while building Qt itself.

When cross compiling Qt (checked via CMAKE_CROSSCOMPILING) or when
-DQT_FORCE_FIND_TOOLS=TRUE is passed, tools added by add_qt_tool will
always be searched for and not built.
In this case the user has to specify the CMake variable QT_HOST_PATH
pointing to an installed host Qt location.

When not cross compiling, tools added by add_qt_tool are built from
source.

When building leaf modules (like qtsvg) that require some tool that was
built in qtbase (like moc), the module project should contain a
find_package(Qt5ToolsCore) call and specify an appropriate
CMAKE_PREFIX_PATH so that the tool package is found.

Note that because HOST_QT_TOOLS_DIRECTORY was replaced by QT_HOST_PATH,
the ensure syncqt code was changed to make it work properly with
both qtbase and qtsvg.

Here's a list of tools and their module associations:
qmake, moc, rcc, tracegen, qfloat16-tables, qlalr  -> CoreTools
qvkgen -> GuiTools
uic -> WidgetTools
dbus related tools -> DBusTools

Task-number: QTBUG-74134
Change-Id: Ie67d1e2f8de46102b48eca008f0b50caf4fbe3ed
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-02 07:30:30 +00:00
Alexandru Croitor
fda57947b4 Fix qmake build after no longer linking against QtCore
Change-Id: I264195ac6e896dd72656afbec2329ae0f1a8bc82
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-29 15:27:01 +00:00
Tobias Hunger
a1752276e0 CMake: Do not link qmake against Qt (not even the bootstrap one)
Qmake should not rebuild all the code in QtCore, but currently it does.
When linking against QtCore, all the symbols get duplicated. A clever
linker will "deduplicate" the symbols again, so this actually works
with shared Qt builds, but it fails for static builds.

Do not rely on the linker being clever and just do not link Qt at all
for qmake.

Change-Id: I0f79ed9176a19ee884dd425e5f23c26cf69dc422
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-29 12:05:06 +00:00
Kavindra Palaraja
869459f3c8 doc: Document the effect of *.qmake.cache properly
Added a sentence to explain how a .qmake.cache file influences the project root.

Task-number: QTBUG-21411
Change-Id: I97766edd96851f1c988ab07f842fb81a339e4ecd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-29 07:35:30 +00:00
Qt Forward Merge Bot
0dff40adf8 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I6ecf7074eda57ef4954fb3fdc7a6d1e8cd229340
2019-04-26 01:00:13 +02:00
Joerg Bornemann
a367c85e53 Doc: Document qmake's plugin_bundle CONFIG value
Fixes: QTBUG-17171
Change-Id: I05bf6ba7498fb05394ff8c118973da2b0dbe4fc3
Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-24 08:53:12 +00:00
Qt Forward Merge Bot
cb10ec56f7 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I26da00aa71b0f0b91c9bfb4a9e8550345ee62875
2019-04-24 01:00:13 +02:00
Joerg Bornemann
de854aa37f Teach qmake MSVC's compiler options /std:c++[14|17|latest]
This fixes the "could not parse compiler option" warning when
generating VS project files.

Fixes: QTBUG-75275
Change-Id: Idd98ae5fdb8ebf5a4e311cbb6cd3ed1daba74ca4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-23 09:09:41 +00:00
Kavindra Palaraja
49be1a3c1f doc: Explain the config members for INSTALLS
Task-number: QTBUG-3209
Change-Id: I00f181a9f29d4ae440a9ad6a2d99877cab482db8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-23 09:05:15 +00:00
Joerg Bornemann
c381df060f Doc: Document QMAKE_[L|C[XX]]FLAGS_RELEASE_WITH_DEBUGINFO
Fixes: QTBUG-17463
Change-Id: Ic2f0870da14db21b1da053716b6d63ba0ed679c9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-04-18 07:29:05 +00:00
Tobias Hunger
6630937e63 Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
2019-04-16 16:32:08 +02:00
Kavindra Palaraja
12b96dbb81 doc: Add clang to the Unix list for Precompiled Headers documentation
Task-number: QTBUG-50011
Change-Id: I18261e62e387eeb74fc7584bf034a11ac75db1be
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-15 14:49:54 +00:00
Liang Qi
3c662bf13c Merge remote-tracking branch 'origin/5.13.0' into 5.13
Conflicts:
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/wasm/qwasmintegration.h

Change-Id: Idf4c7936513fb1f21daa8f6105b8545f13447bb8
2019-06-11 10:30:48 +02:00
Liang Qi
9967a011ea Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	qmake/generators/makefile.cpp
	src/plugins/platforms/cocoa/qcocoaintegration.h
	src/plugins/platforms/cocoa/qcocoaintegration.mm

Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I5a61e161784cc6f947abe370aab8f2971a9cbe78
2019-06-07 13:19:27 +02:00
Kai Koehne
5f30fd6426 qmake: Cleanup
Fix clang warnings that are disabled in the default build.

Change-Id: I4e773a24884db94acdc6c295d3f66da07cd8a5bd
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-06-05 10:59:43 +02:00
Joerg Bornemann
224a60989e Fix determination of source and build roots
QMake searches a .qmake.conf file to determine the source root of the
project, and a .qmake.cache to determine the build root.

If a .qmake.conf exists but no .qmake.cache in the build directory is
found, a build root would be set that is only valid if the build
directory is at the same depth as the source directory.

The invalid build root resulted in the creation of .qmake.cache files
at "interesting" locations (e.g. high up in the directory tree), a
potential cause for even more interesting build failures in the
future.

Fix this by splitting up the loop that determined build and source
root. Both are now determined independently of each other.

Fixes: QTBUG-76140
Change-Id: Ib5c922b87879fcf2f076298a69abcdbc4e8587b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-04 21:19:37 +02:00
Joerg Bornemann
4da47d0fba Make sure .pc, .prl and .la files are created for header_only modules
Those modules are TEMPLATE=aux, so they weren't triggering the file creation
here.

To make this work properly we have to:
  - check for TEMPLATE aux in the right places
  - add a dummy target to INSTALLS to actually trigger the creation
  - initialize PRL_TARGET for aux templates

Fixes: QTBUG-75901
Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Idce141629dd34287808bfffd159f92ac28c6c8b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 15:06:29 +02:00
Joerg Bornemann
c64f8ca232 Do not write 'Libs:' into .pc files if TEMPLATE is not 'lib'
Especially for header modules we don't want a 'Libs:' entry in their
.pc file.

Task-number: QTBUG-75901
Change-Id: I39037d3132e39dd360532e1425f794ebec28e0bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 14:58:39 +02:00
Joerg Bornemann
60136b1a84 Fix meta file replacements if matches are empty
QMake code like
    rplc.match =
    QMAKE_PRL_INSTALL_REPLACE += rplc
led to the generation of invalid sed calls in the Makefile.

It is already actively checked for empty matches, but if *all* matches
are empty, the sed call looks like
    sed foo > bar
which is invalid.

Task-number: QTBUG-75901
Change-Id: I173ed99826414dcf06253a15a247f7d067ee3977
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 14:58:39 +02:00
Joerg Bornemann
68866b1a7b Fix QMAKE_EXTRA_COMPILER names in VS projects
Use the whole value of 'name', not just the first element, and also
replace variables like ${QMAKE_FILE_IN}.

This fixes the file_copies feature (COPIES) for Visual Studio
projects, because for every entry in COPIES an extra compiler is
created with a name 'COPY ${QMAKE_FILE_IN}'. Before this patch the
name and the generated file filter would be just 'COPY'. However,
duplicate filters are being skipped by the VS project generator. All
but the first COPIES entry was ignored.

Fixes: QTBUG-76010
Change-Id: Icaa5d2cb8d88ae3ef8ce86220198bca1b9e673f5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-31 10:48:35 +02:00
Joerg Bornemann
085d1335d1 Warn about invalid SUBDIRS content
Invalid SUBDIRS values like

SUBDIRS += foo \
           bar \ \
           baz

would produce a Makefile with a sub-- target that will call the make
on the same Makefile again recursively, letting make run forever.

Ignore values like this and print a warning message.

Fixes: QTBUG-76068
Change-Id: I6ca0f8c8238249f1be02d8c311b4c148fd80e707
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-28 13:40:42 +02:00
Kai Koehne
bac2b0ef36 qmake: Escape trailing backslash for OBJECTS_DIR for MinGW
qmake automatically appends a dir_sep to a few directory paths (see
MakefileGenerator::initOutPaths), and various .pri and .prf files rely on
that. Anyhow, for non-MSys MinGW on Windows this creates a problem,
because mingw32-make will interpret the backslash in

  OBJECTS_DIR = some_path\

to escape the following newline. We have been working around this
problem in various ways:

- winmakefile.cpp just removes the trailing \ for OBJECTS_DIR, at the
  cost of not being compatible with logic in .prf/.pri files that rely on
  the separator.
- winmakefile.cpp adds a '#avoid trailing-slash linebreak' comment for
  DESTDIR.  Anyhow, this does not seem to work for mingw32-make: If you
  reference $(DESTDIR), the variable will contain trailing spaces.
- unixmakefile2.cpp duplicates a trailing \ for DESTDIR.

The last approach is now taken also for OBJECTS_DIR.

Task-number: QTBUG-75257
Change-Id: Ie8171a990a9ce1cfbf1b94037252ef2392313338
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-13 04:37:59 +00:00
Liang Qi
c7af193d2e Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/widgets/styles/qstyle_p.h

Change-Id: I0e6e856bd6628da1135b3ba674dddffabbeb5c09
2019-04-11 07:47:21 +02:00
Liang Qi
63e88f60a7 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13 2019-04-10 17:33:14 +00:00
Liang Qi
a20da2353c Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	mkspecs/win32-clang-msvc/qmake.conf
	src/gui/image/qpnghandler.cpp

Change-Id: Ied79d02912ffb3a307a99483df7db08c7f9d0cd8
2019-04-10 08:16:20 +02:00
Qt Forward Merge Bot
ff88e20b83 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I44eda44bf424fdcffab048a2534905d6162e5559
2019-04-10 01:00:08 +02:00
Allan Sandfeld Jensen
eaf20420f8 Fix precompiled headers with clang-cl
Clang-cl couldn't find the header given to it by -FI when it isn't in
any of the included directories.

Additionally clang-cl 8 has a bug with exported templated classes with
inline methods that causes it to have missing symbols at link time. We
work around this.

Fixes: QTBUG-74563
Change-Id: I7becf05fa8edb07bd4cefe12bee3737e5e1dfa14
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-09 21:58:54 +00:00
Liang Qi
ac244dbcf2 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13 2019-04-09 19:43:30 +00:00
Allan Sandfeld Jensen
95f787bfdc Replace Q_DECL_NOTHROW with noexcept the remaining places
The first replacement had missed objective-C++ code some places ourside
the src dir.

In C-files Q_DECL_NOTHROW is replaced with Q_DECL_NOEXCEPT as we still
need to turn it off when compiled in C mode, but can get rid of the old
NOTHROW moniker.

Change-Id: I6370f57066679c5120d0265a69e7e378e09d4759
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-09 14:48:42 +00:00
Joerg Bornemann
9617791075 Let QINSTALL copy hidden files when installing directories
When installing directories, QINSTALL must not ignore contained hidden
files to be consistent with the old INSTALL_DIR.

Fixes: QTBUG-66835
Change-Id: I3a7c952dcac9732d5b17c5a258f87ca277b388d2
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-09 08:16:25 +00:00
Kai Koehne
8cd0a39dd7 qmake: Remove special-handling of cl.exe's -Gm option
The comment hints that it's fixing an issue in Visual Studio 2013, which
we don't support anymore.

In all supported Visual Studio Versions -Gm is actually deprecated
anyhow, and not set anymore by default. So I guess it's safe
to remove the special handling here.

Change-Id: I2e8ff85350ba651d9a763aabba7b6494ba88d82e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-09 07:00:18 +00:00
Qt Forward Merge Bot
93acb76222 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I05d14a40e17554691bad369d0363e88413afd9b3
2019-04-09 01:00:06 +02:00
Joerg Bornemann
448177d857 Let "qmake -install qinstall" set default permissions 0644 and 0755
...like the install commands before Qt 5.9 did.
This ensures consistent permissions. Also, we can throw away the code
that took care of removing and re-adding the read-only flag on Windows.

This reverts commit a0b5d6e60f with the
addition of preserving permissions when copying directories to properly
install app bundles (QTBUG-74912).

Fixes: QTBUG-74733
Task-number: QTBUG-74912
Change-Id: Iee6d7c5e86787dd3ada5e5e9441209d418100b1f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-08 18:39:39 +00:00
Qt Forward Merge Bot
01a269593d Merge remote-tracking branch 'origin/5.12.3' into 5.12
Change-Id: Id60d508c0f25fd5e67be07daafd2d4c56ae73934
2019-04-08 09:53:39 +02:00
Qt Forward Merge Bot
3460e6e941 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ib7c4fc52915b5e6c72b9aa262fb59f2a041dccd7
2019-04-06 01:00:46 +02:00
Qt Forward Merge Bot
ce7f14d2e0 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iec860bb703f983b7438e67c695b9c454e72b3e0f
2019-04-06 01:00:08 +02:00
Qt Forward Merge Bot
0998a9d1d5 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I010a6322d12e038fdce247a58dfb05e204c2ff3b
2019-04-05 10:57:24 +02:00
Kai Koehne
5f7b0e5ff4 qmake: Remove dead code
Silences a clang warning

Change-Id: I5ade49326afcce964ffb5c24b5708977950d123e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-05 07:48:34 +00:00
Jani Heikkinen
a0b5d6e60f Revert "Let "qmake -install qinstall" set default permissions 0644 and 0755"
This reverts commit 3cdf46059a.

It seems change is causing regression & is reverted now to be able to
proceed with releases

Task-number: QTBUG-74912
Change-Id: Ib2365b96ee98fbbcc8853cc7f8726c157c1913a7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-04 15:24:05 +00:00
Joerg Bornemann
6fff899697 Document in which Qt version a qmake function was introduced
...starting with Qt 5.0.0.

The text is manually inserted there, because \since does not work
within sections.

Task-number: QTBUG-74737
Change-Id: I0fe2d0a113d48be0266030c8466b062c6f743aab
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-04-03 20:23:29 +00:00
Qt Forward Merge Bot
682513bed4 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I99a27f9a0402e1ccad45a2d062d784f8d9a08dd3
2019-04-03 01:00:11 +02:00
Qt Forward Merge Bot
ffe9c395dc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ia5d893e57deb78bc32e2053a5a79543ff847fe32
2019-04-02 01:00:26 +02:00
Joerg Bornemann
9e97d64ccd Fix installation of .pdb files for applications that have VERSION set
For applications that set VERSION the installation targets of pdb
files were wrong in qmake's nmake Makefile generator.

Replace code that tries to reconstruct that target's versioned
extension with TARGET_EXT which already contains the fully resolved
target extension.

Fixes: QTBUG-74265
Change-Id: I9553a5f70170e077a59c866079ae51647ae80bef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-03-31 12:45:24 +00:00
Joerg Bornemann
3cdf46059a Let "qmake -install qinstall" set default permissions 0644 and 0755
...like the install commands before Qt 5.9 did.
This ensures consistent permissions. Also, we can throw away the code
that took care of removing and re-adding the read-only flag on Windows.

Change-Id: I06bc3af8817f18c016119fbcb7360800d6c129bd
Fixes: QTBUG-74733
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-31 12:44:41 +00:00
Liang Qi
29f01b32f5 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/configure.json

Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
2019-03-31 12:39:42 +02:00
Qt Forward Merge Bot
0a7302abbc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9935bacae0d6ba532418fc3d28adbc7ca1463604
2019-03-30 01:00:07 +01:00
Joerg Bornemann
0ba8ed2c5f Add .lib and .exp files to clean targets only for libraries
There is no point in adding those to applications.

Change-Id: Ic8d3009b5099c266f56b5bdaa831d0816510bc3b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-03-27 07:39:14 +00:00
Yuhang Zhao
b73eef0b51 Clang: Enable precompiled header for qmake
Tested with Clang 8.0.0, everything works fine.

Task-number: QTBUG-74563
Change-Id: I3e216b062352851a7be59543ef1a4029f919111d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-21 23:46:20 +00:00
Liang Qi
b1a216649e Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	qmake/generators/makefile.cpp
	qmake/generators/unix/unixmake2.cpp
	src/corelib/thread/qthread_unix.cpp
	tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
2019-06-14 13:45:18 +02:00
Alexandru Croitor
3f03917b54 Fix Windows build
- Fix qmake build
- Fix QtNetwork moc-ing, by including the moc files
  inside the cpp files
- Fix sql odbc plugin by including QT_PLUGIN define
- Fix Boostrap to link against the Platform target, to get the
  correct Unicode and WIN64 defines.
- Fix vulkan headers to be found
- Fix freetype bzip and png unresolved symbols / linker issues
  when building minimal platform plugin (also need to make
  sure to use the vcpkg toolchain instead of CMAKE_PREFIX_PATH
  because then find_package is overridden, which does magic
  to properly propagate static library dependencies).
- Fix qfilesystementry test not to be built without private
  tests feature (it led to undefined symbols issues).
- Make sure to remove QT_NO_CAST_TO_ASCII define when building
  QtCore, so that the qstringbuilder3 test builds
  successfully.

Task-number: QTBUG-74140
Change-Id: I353d08392b604d55f8e62cdd8696d1e19a3c084a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-18 15:34:52 +00:00
Qt Forward Merge Bot
261c0dedac Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I056b658ffe9390dfcbe2787e2bddc7f4e9b389dd
2019-03-09 01:00:55 +01:00
Liang Qi
2add2dbdaa Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/network/access/http2/hpacktable_p.h

Change-Id: Ie0c296667dfdebba84f4858056a1ac80c24ee7df
2019-03-06 12:31:50 +01:00
Christian Ehrlicher
f8f592d5c2 QString: mark obsolete functions as deprecated
Mark obsolete functions in QString as deprecated so they can be removed
with Qt6:
 - QString::sprintf()
 - QString::vsprintf()

Change-Id: I9b7748db95291c34b95ff3ad3e3aabc8215aeaae
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-03-04 16:54:04 +00:00
Joerg Bornemann
cc7444eb65 Fix library search path order on Windows
Commit 2327944d added the QMAKE_DEFAULT_LIBDIRS to the library search
paths without taking care that explicit library search paths should be
inserted before system search paths.

Copy the behavior of the UnixMakefileGenerator, esp. of commits
5bc9541e and e185f343.

Fixes: QTBUG-73959
Change-Id: I7e951f432bb5f71ce4bcdb18b7102b4380441181
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-03-03 16:55:55 +00:00
Qt Forward Merge Bot
84e15d6f48 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ic0037eac1d85a0e60e7b1a590d49b5ee6205bfc8
2019-03-03 01:00:25 +01:00
Qt Forward Merge Bot
607338f98f Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I83f6ed9480bf21020ce7a9431010d87a88df84a1
2019-03-02 01:00:08 +01:00
Qt Forward Merge Bot
7aa204d5b3 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Icec0aa703d8a13efa9f1634a1a353eb9d63685c8
2019-03-01 01:00:54 +01:00
Joerg Bornemann
077e499304 Handle QMAKE_SUBSTITUTES input files as Latin 1
QMake's strategy is generally "pretend everything is Latin 1", which
basically equals "do 8-bit pass-through". Change the handling of
QMAKE_SUBSTITUTES input accordingly to avoid conversion losses when
converting from and to UTF-8.

Fixes: QTBUG-72130
Change-Id: Id903bbd2afa99708c92fd09fab3db944aa819a94
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-02-28 09:00:32 +00:00
Qt Forward Merge Bot
043f99954f Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Icc9b061c56e969756f0351c936cdeb8063c86079
2019-02-28 01:00:15 +01:00
Alexandru Croitor
84af8f9b0b Fix build of qmake on macOS
Two changes were needed:
- correctly link against frameworks
- use qcore_mac.cpp instead of qcore_mac_objc.mm, because we don't
  link against AppKit

Change-Id: Ibd9d6d367a7fcdf7dce277c1b06d36c491294eeb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 16:11:53 +00:00
Joerg Bornemann
b0dcb94d94 vcxproj generator: Fix files being in multiple filters
Visual Studio doesn't support files being in multiple filters and
refuses to load such projects. Source files that appear in variables
that are mapped to file filters (SOURCES, TRANSLATIONS, ...)  must not
be added to a second filter if they are input for an extra compiler.

Fixes: QTBUG-74004
Change-Id: Id2d752059c98d04e8154a7848c91f29a94bd092a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-02-26 07:30:53 +00:00
Joerg Bornemann
8f507a0b02 Display EXTRA_TRANSLATIONS files in VS projects
This amends commit 01d2f35b.

Change-Id: I958c924f7f5a477f5ebced895ce2678d282526ad
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-02-26 07:30:50 +00:00
Qt Forward Merge Bot
2a1292b916 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I4b56ce8c76729d9fc60995564299f8f27336fcde
2019-02-22 19:59:08 +01:00
Joerg Bornemann
0e71db3c8e Deduplicate initialization code for default variables
Use the writeDefaultVariables method also for the
Win32MakeFileGenerator. Remove the initializations that are already done
in Makefile::writeDefaultVariables.

Change-Id: I590cc5d7031de67dd830e6113849ab080dbf2325
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-16 11:36:36 +00:00
Joerg Bornemann
43a66453c5 Clean up class definitions of makefile generators
Remove pointless constructors and destructors.

Change-Id: I7aea8587bf3598b6f5324aac8898edf227475d63
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-16 11:36:22 +00:00
Liang Qi
c0359bd3c3 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/global/qfloat16.cpp
	src/corelib/global/qfloat16.h
	src/plugins/platforms/windows/qwindowswindow.cpp

Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
2019-05-15 07:11:41 +02:00
Marc Mutz
7cba2acd2c qmake: replace QLinkedList with std::list
This is in preparation of deprecating QLinkedList.

There is but one substantial change: Instead of copying the linked list,
we move it now, and instead of copying items between these two lists, we
use std::list::splice(), which just relinks nodes. It is a bit surprising
that the comment on the ProValueMapStack suggests references into the
container must remain stable, and then some code changes addresses by
making copies of the elements.

This was probably a bug waiting to manifest itself.

Since nothing else in qmake is using QLinkedList now, remove qlinkedlist.o
from the qmake build.

Change-Id: I08a5b0661466bf50ad8f9f8abf58bc801aef4ddc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-13 19:18:59 +00:00
Marc Mutz
0d88721d77 qmake: use std names on a linked list
This is preparation of moving from QLinkedList to std::list, which is in
preparation of deprecating QLinkedList.

Change-Id: Ief259bc8c7178be5ca04812c6890cf65d86c069d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-13 16:39:22 +00:00
Liang Qi
388fe97f2a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/tools/qstring.cpp

Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
2019-05-13 08:04:58 +02:00
Lars Knoll
92f9842732 Deprecate conversion functions between QList and QSet
Users should use range constructors instead to do the conversion.
Keep conversion methods between QList and QVector as these will turn
into a no-op in Qt 6, whereas forcing people to use range constructors
would lead to deep copies of the data.

Change-Id: Id9fc9e4d007044e019826da523e8418857c91283
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-07 14:15:44 +00:00
Liang Qi
c2b553784d Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/kernel/qobject.cpp
	src/corelib/kernel/qvariant.h
	src/corelib/tools/qlist.h

Done-With: Milian Wolff <milian.wolff@kdab.com>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I6803f7239aa137a51a7467fab7cc7a01302a848d
2019-05-07 11:58:30 +02:00
Lars Knoll
343528841e Prefix textstream operators with Qt::
As the non prefixed variants are deprecated

Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-02 11:52:02 +00:00
Qt Forward Merge Bot
03f7d0a005 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I1c9449ab064deed1367a7e5dbedfcb489f28140e
2019-04-27 01:00:11 +02:00
Liang Qi
dc37318684 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/gui/util/qshaderformat.cpp
	src/gui/util/qshaderformat_p.h
	src/widgets/graphicsview/qgraphicsitem_p.h

Change-Id: Idafd88eb9a0a15b4af29f6143d009c1ec8ceecca
2019-04-24 09:52:30 +02:00
Samuel Gaist
e2906ea5c4 QRegExp include cleanup
QRegExp includes can be found in several files where there's not even a
use of the class. This patch aims to avoid needless includes as well as
follow the "include only what you use" moto.

This patch removes a QRegExp include from the QStringList header which
means that there is likely going to be code breaking since QStringList
is used in many places and would get QRegExp in.

[ChangeLog][Potentially Source-Incompatible Changes] qstringlist.h no
longer includes qregexp.h.

Change-Id: I32847532f16e419d4cb735ddc11a26551127e923
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-19 21:21:17 +00:00
Qt Forward Merge Bot
64085d9b2f Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9e7cb1b131b7b216aad8ed1b1536669fd1557c21
2019-02-22 01:00:27 +01:00
Oliver Wolff
1136c9849e qmake: vcproj: Fix windeployqt config for dll targets
Instead of hardcoding the target's extension to ".exe" we should rely on
target information available in Visual Studio. $(TargetFileName) is
documented as "The file name of the primary output file for the build
(defined as base name + file extension)." so it can be used instead of
$(TargetName) together with ".exe".

Change-Id: I103d8d13456910617b2d53c9c8f4e2935eb93015
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-02-21 15:12:29 +00:00
Qt Forward Merge Bot
0c0c4a23bc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I830beea26863323ab78a5d4b093f7763d77ad3da
2019-02-21 01:00:08 +01:00
Qt Forward Merge Bot
035f934d7a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp

Added tests/auto/testlib/selftests/expected_crashes_5.txt to work
round the output of the crashes test (which exercises UB, see
QTBUG-73903) being truncated on one test platform.

Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
2019-02-20 09:51:12 +01:00
Dmitry Sokolov
441520141e Inline expression to bypass compiler bug
MSVC managed to trigger the this != &other assertion in
QString(const QString &other); so just skip creation of the
intermediate string in the function whose body tripped over this.

Change-Id: I687003cfc588531018c6069863ce2a76078c8e3f
Fixes: QTBUG-73802
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-19 10:42:54 +00:00
Qt Forward Merge Bot
67c70b22f6 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
2019-02-19 01:00:08 +01:00
Yuhang Zhao
11111c5a7d qmake: Optimize for speed instead of size
Change-Id: Ide06365f3ba0db673749a9938afc18fdf7480542
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-18 23:03:48 +00:00
Joerg Bornemann
8fe3680193 Add cmdline feature to qmake
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".

Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-02-18 07:12:14 +00:00
Qt Forward Merge Bot
ef2ddcf551 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I8cad26f17834dbc9f7151edc0f17786f9e32025d
2019-02-15 01:00:51 +01:00
Oswald Buddenhagen
2634ba5b4d qmake: don't mess up linking order of frameworks
make it "last one wins", consistently with regular libraries. this
isn't really relevant in qmake, because the order matters only for
static frameworks, which qmake defines out of existence.

note that specifying frameworks by full path does not work, so we
don't need to amend 9d76beee5 in that regard.

Change-Id: Ib027109339e1b5973c577d69906b6daf83ba9611
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-14 19:29:48 +00:00
Edward Welbourne
4b4a288f5f Recognize UNC paths as absolute (i.e. not relative)
IoUtils::isRelativePath() didn't attempt to consider UNC paths, due to
a belief that qmake fails on them so badly that it wasn't worth the
extra code.  However, it turns out Qt Creator's copy of this code does
need to take this into account, so start the change off in qmake's
version so as to keep in sync.

Task-number: QTCREATORBUG-21881
Change-Id: I3084b87c1d3ca6508255e94e04ac8db3ceaebb7e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-13 14:15:10 +00:00
Oliver Wolff
083c03e22b qmake vcxproj generator: Use correct version in solution header for 2017
Change-Id: I360202c88a8da84f3ecaf43304fcf6f5a992b953
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-13 14:04:57 +00:00
Joerg Bornemann
4aafe68e1a qmake vcxproj generator: Update platform toolset and solution header for VS 2019
Change-Id: Id01f28f2ef3e271fa48dddf5f8ccb6b057180aa0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-13 14:04:56 +00:00
Joerg Bornemann
2dcfaf7bee qmake/vcxproj generator: Fix bug in extra compiler initialization
QMake ignored every extra compiler that sets variable_out and whose
output does not have a builtin compiler (C++, C).

What the code wants to achieve is to ignore extra compilers that put
their output into variables that are handled "somewhere else already",
e.g. are in the otherFilters list. Evidence for that is to be found in
the addOnInput == true if branch.

Task-number: QTBUG-71283
Change-Id: I8c1d76febccacb450cd14ad7a1f4b87726832312
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-02-13 13:01:49 +00:00
Kevin Funk
4c51273f1f cmake: Build qmake using CMake
Change-Id: Ia2ad09774252154d19d7c80abfcd72ecd09025ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-13 11:16:28 +00:00
Qt Forward Merge Bot
d3b3be6865 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iad53d4f21263718b8ecf15fd2d1170d24c7b675d
2019-02-12 13:53:22 +01:00
Yuhang Zhao
3b87ecc06a Win32 makefile for qmake: Use proper linker
Use xilink for ICC and lld-link for Clang.

Change-Id: I13c74339ae9e3e5c97210afd20a53c7e474b873b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-11 23:27:57 +00:00
Simon Hausmann
4a9d96cd91 Fix make install
Pick up mkspecs/ from the top-level project (qtbase) directory

Change-Id: I78c69f31219484cc7eaa408b0a7e3eeaa0ac6cf2
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-11 10:31:28 +00:00
Liang Qi
fbfacd33be Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/android/templates/AndroidManifest.xml
	src/network/ssl/qsslsocket_mac.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/corelib/kernel/qtimer/BLACKLIST
	tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
	tests/auto/testlib/selftests/expected_blacklisted.lightxml
	tests/auto/testlib/selftests/expected_blacklisted.tap
	tests/auto/testlib/selftests/expected_blacklisted.teamcity
	tests/auto/testlib/selftests/expected_blacklisted.txt
	tests/auto/testlib/selftests/expected_blacklisted.xml
	tests/auto/testlib/selftests/expected_blacklisted.xunitxml
	tests/auto/testlib/selftests/expected_float.tap
	tests/auto/testlib/selftests/expected_float.teamcity
	tests/auto/testlib/selftests/expected_float.txt
	tests/auto/testlib/selftests/expected_float.xunitxml

Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
2019-02-08 12:31:02 +01:00
Tobias Hunger
756c64c539 qmake.pro: Fix missing headers and add missing line continuation
Change-Id: I308cff86f1af2c24eee13ec0531d967a3770ed04
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-08 10:45:52 +00:00
Joerg Bornemann
29d5a287ab Make the Makefile a dependency of default targets for nmake
If the user changes the .pro file, the Makefile is supposed to be
re-generated by calling qmake again. NMake however lacks a "Makefile
remake feature" like GNU make has.

The generated Makefiles for nmake however have already a proper
Makefile target that can be used to re-generate the Makefile. What was
missing is the dependency from an entry-target in the meta-Makefile.

Now changes in the .pro file trigger a re-generation of
Makefile.Debug/Makefile.Release when calling nmake without target
arguments or with "debug" or "release".

Fixes: QTBUG-29193
Change-Id: I9f2dd5deba4a043ab6c9502bb0b0ba83dc843612
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-02-04 08:10:25 +00:00
Giuseppe D'Angelo
7847e6bc02 Enable deprecation warnings by default
With Qt 6 in sight, people need to start moving away from
their deprecated APIs, as we want to remove them all in 6.0.
We are marking deprecated APIs with deprecation attributes,
but by default we're disabling deprecation warnings, making
them an opt-in by the user.

We need to do the opposite: make deprecation warnings enabled
by default, and have an opt-out define.

[ChangeLog][QtCore][Important Behavior Changes] Qt now
enables by default warnings when using APIs marked as
deprecated. It is possible to disable such warnings by
defining the QT_NO_DEPRECATED_WARNINGS macro. The old
QT_DEPRECATED_WARNINGS macro which was used to enable
this warning now has no effect (warnings are automatically
enabled).

Task-number: QTBUG-73048
Change-Id: Ie2b024fd667eb876b6ac9054cbbbc5a455cb9d5c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-02 02:31:05 +00:00
Liang Qi
980567b3a3 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/android/templates/AndroidManifest.xml
	tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
2019-01-26 08:35:40 +01:00
Christian Ehrlicher
7c69f6171d QFile/QFileInfo: mark readLink() as deprecated
QFile/QFileInfo::readLink() functions are obsolete but were not marked
as deprecated.
Explicit mark them as deprecated so they can be removed with Qt6.

Change-Id: I52424dc5441e1f5b01015713df990bbec5186caa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-23 18:49:15 +00:00
Joerg Bornemann
c6bd9082f4 Resolve macOS framework headers for extra compiler depend_command
On macOS, if an extra compiler returns a framework include via its
depend_command, we must resolve it properly.

For example, the uic extra compiler might return an include
"QtQuickWidget/QQuickWidget", but the actual header file is located in
"QtQuickWidget.framework/Headers/QQuickWidget".

Fixes: QTBUG-72641
Change-Id: I42f11c74d01c88db8a32025b7f04d9ad50b2d08b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-01-15 12:43:12 +00:00
Joerg Bornemann
b95a4bbe84 MakefileGenerator: deduplicate code
Factor out a resolveDependency method.
We will enhance it in a subsequent commit.

Change-Id: I4eead8bd03066c2ccbc9d9276acbc9f6c3bc6b97
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-15 12:43:06 +00:00
Samuli Piippo
2327944d24 qmake: use default libdirs to search for prl libs
Default libdirs are never added to the modules' LIBS and if
Qt was configured to use one of the default libdirs, module
might end up without any path to search for its prl files.

Add default libdirs to the search path similar as it's done
in unix/makefile generator.

Fixes: QTBUG-72855
Change-Id: I43c5bae0d54ba9427ab0ad3eab61ba0c4e2cbde8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-01-08 09:46:42 +00:00
Qt Forward Merge Bot
c497f79ad4 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ieb57137ee2b7d0c505e3531d5aa1bcb66978847e
2019-01-07 01:00:08 +01:00
Oswald Buddenhagen
45e4dfb449 qmake: rewrite msvc/nmake cross-build environment setup
rather than reproducing vcvarsall.bat's functionality as hard-wired code
in the nmake generator, just invoke the actual script from
toolchain.prf. this is much easier, more future proof, and - critically
- makes the detected variables available to configure's new library &
header search facilities.

[ChangeLog][Important Behavior Changes][qmake][WinRT] Cross-builds will
now ignore pre-set values of %INCLUDE% and %LIB% when building target
executables. If necessary, use configure's -I and -L switches when
building Qt, and pass QMAKE_INCDIR and QMAKE_LIBDIR on qmake's command
line when building own projects.

Change-Id: I36f53e8880d6523f3f6f7a44d40d87d04bd06854
Reviewed-by: Thomas Miller <thomaslmiller91@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-01-05 20:33:24 +00:00
Oswald Buddenhagen
f89ac0101a qmake: add $$read_registry() function
Change-Id: I7f9f17e0f44c273e4754d1decc92a8594cad8658
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-01-05 20:33:07 +00:00
Oswald Buddenhagen
fff59911a3 qmake: add QMAKE_EXPORTED_VARIABLES
because QMAKE_EXTRA_VARIABLES sometimes just ain't enough.

Change-Id: I739e5b6510e4701ca0a86834e4f9a978d7ef1cf4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-01-05 20:32:56 +00:00
Liang Qi
03039979b5 Merge remote-tracking branch 'origin/5.12' into dev
Also blacklist tst_QRawFont::unsupportedWritingSystem() and
tst_QGlyphRun::mixedScripts() on windows for now.

 Conflicts:
	qmake/generators/makefile.cpp
	src/corelib/itemmodels/qstringlistmodel.cpp
	src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
	tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
	tests/auto/gui/text/qglyphrun/BLACKLIST
	tests/auto/gui/text/qrawfont/BLACKLIST

Task-number: QTBUG-72836
Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
2019-01-04 07:33:14 +01:00
Oliver Wolff
f9d8762d37 winrt: Remove yet another Windows Phone leftover
Hardware and camera button handling are phone specific APIs we no longer
support in Qt.

Change-Id: Ib11f894a426b8e4b71acf24876437ddab2cea548
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-01-02 23:32:34 +00:00
Oswald Buddenhagen
3f2786e322 qmake: fixify target paths of extra compilers more consistently
... so we don't get into situations where a target has a relative path,
while another target depends on it with an absolute path.

Task-number: QTBUG-36768
Change-Id: Icc5b249914bb3f095f4a6542c30bacf5ea6f9ec9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-20 21:01:07 +00:00
Andy Shaw
f377b1ddfb qmake: Add support for installing executable files without calling strip
Since some files are still executable (such as bash scripts) then they
should not get strip called on them when installing in those cases.
So by adding .CONFIG = nostrip, it indicates that strip should not be
called on this.

Fixes: QTBUG-60751
Change-Id: I19d502c07644daf9d487a8817c8e57d96eedab60
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-20 15:03:10 +00:00
Oswald Buddenhagen
91d98321d3 qmake: move QT_BEGIN_NAMESPACE to correct place
this makes no difference whatsoever, because qmake isn't actually built
in a namespace, but it makes the new qtc code model happy.

Change-Id: I70ad8e16cceff73276a821219fc80bab365954b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-12-19 19:21:35 +00:00
Qt Forward Merge Bot
4b04e47be9 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Iad06d8c07dfc288c9d1a9f7ee3520285cea60546
2018-12-15 01:00:31 +01:00
Oswald Buddenhagen
9d76beee5b qmake: don't mess up linking order of libraries
... which are specified by full filepath, by making the de-duplication
consistent with that applied to libs specified with -l, that is, last
one wins.

the problem existed "forever", but it became more visible after the
recent configure changes.

fwiw, Win32MakefileGenerator is not affected, because it has the
opposite problem: it de-duplicates everything (including object files)
in "last one wins mode". it might make sense to change that as well.

Change-Id: Id7ef1d394fcc9d444450672c06a6f11af2b19eab
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
2018-12-14 17:20:11 +00:00
Qt Forward Merge Bot
ad4f359f80 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I0fe623517af28e408b642c879efd59f633ab63ac
2018-12-13 01:00:11 +01:00
Nico Vertriest
4e54ac7c89 Doc: correct syntax error in qmake manual
Change-Id: I600f8c9ea8e55dad19345bd4d726cf8d5438e9ce
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-12-12 17:24:54 +00:00
Qt Forward Merge Bot
a2fd99c430 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I91e684e74c36467efda8ded6ed19791baa0c1a1f
2018-12-11 01:00:13 +01:00
Joerg Bornemann
6a221f3d05 Fix qmake's detection for conflicting source files for nmake
Consider the following source tree:
  foo/narf.cpp
  bar/narf.c
  bar/gnampf.cpp

The .pro file has
  SOURCES += foo/narf.cpp bar/gnampf.cpp
The file bar/narf.c is not supposed to be built for whatever reason.

QMake's nmake Makefile generator generates inference rules of the form

  {.\foo}.cpp{debug\}.obj::
  ...

for every source subdirectory and every source file extension.
Thus, we have

  {.\foo}.cpp{debug\}.obj::
  {.\bar}.cpp{debug\}.obj::
  {.\bar}.c{debug\}.obj::

Depending on the exact execution order of the inference rules (which
depends on the names of the files) the latter rule might get picked,
and we're erronously compiling bar/narf.c even though it's not
referenced in the .pro file.

Conclusion: QMake's detection of conflicting source files must
consider the base names of source files, and not the exact file names.

Fixes: QTBUG-72059
Change-Id: I50c2725ae2a7421053369a10680230f571af00ea
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-12-10 06:46:15 +00:00
Liang Qi
5d5c00c676 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/gui/painting/qdrawhelper.cpp

Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
2018-12-04 09:58:43 +01:00
Ulf Hermann
5ed471a80a qmake: Escape '=' in dependency paths for unix make
'=' cannot be handled in the same manner as other "critical" characters
as no amount of backslashes will escape it. Use a variable instead.

The documentation for nmake suggests that '=' in file names is not among
the "Special Characters in a Makefile". Therefore, we assume nmake can
handle it and don't escape it.

Fixes: QTBUG-67262
Change-Id: Ib60f808d7d4e981c98f7d8bf2075d55b2b7f3b7d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2018-11-30 14:47:42 +00:00
Allan Sandfeld Jensen
1f998e040e Fix crash in qmake parsing
The read from a QHash needs to be protected too if other threads are
writing.

sync-up with qtc, no actual effect on qmake itself.

Fixes: QTCREATORBUG-21416
Change-Id: I75e5634e11b10056d6dbb6fdceef482ca2222ca1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from qtcreator/5f79b5d2e5e33321cdcd00362f0d6d9442a73ec2)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-29 07:46:02 +00:00
Lars Knoll
b98c43ea60 Compile with QT_STRICT_ITERATORS defined
This will be the only options for Qt 6, so make sure the code compiles now.

Change-Id: I23f791d1efcbd0bd33805bb4563d40460954db43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-26 07:04:24 +00:00
Joerg Bornemann
e04aaf188c Support 'CONFIG += precompile_header_c' in VS projects
The CONFIG value precompile_header_c was ignored in the VS project
generator. Add a member VcprojGenerator::pchIsCFile that is set to
true if precompile_header_c is active.
The code in modifyPCHstage had to be rearranged to separate the three
parts for stable.h, stable.cpp and other files.

Task-number: QTBUG-62821
Change-Id: I340eb165baa22cafcb64815cf223ce9a21aca558
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-11-24 20:12:16 +00:00
Joerg Bornemann
e5f94f0f05 Simplify VCFilter::modifyPCHstage a bit
Merge two nested if blocks.
This reduces the diff size for a subsequent commit.

Change-Id: If60938077169fc6686329cc5c30ebc97ada013a1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-11-24 20:12:10 +00:00
Joerg Bornemann
54fc1b5ae6 Remove variable autogenSourceFile from VCFilter::modifyPCHstage
There's no point in having it, and this will reduce the diff of a
subsequent commit.

Change-Id: I3d27d6808c585b87a44df2499f2fcea4331befbb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-11-24 20:12:05 +00:00
Joerg Bornemann
e824136a3b Rename VcProjGenerator::[autogen]precompCPP to [autogen]precompSource
Those names are a better fit as we want to support C precompiled
headers in a subsequent commit.

Change-Id: Ie3f852da945b9b2cf0e363c81f1a4b3063f27372
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-11-24 20:12:01 +00:00
Liang Qi
bf58c70546 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/io/qdir.cpp
	src/corelib/kernel/qtimer.cpp
	src/corelib/kernel/qtimer.h

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
2018-11-22 01:53:29 +01:00
Oswald Buddenhagen
127005d360 qmake: fix return type of toLongLong()
Fixes: QTBUG-71886
Change-Id: I62880e7ad8a1707c9094b07cf89d5c0c7841d235
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-11-21 05:37:02 +00:00
Joerg Bornemann
6e34552638 Enable users to specify WindowsTargetPlatform[Min]Version in VS projects
[ChangeLog][qmake] Introduced the variables
WINDOWS_TARGET_PLATFORM_VERSION and
WINDOWS_TARGET_PLATFORM_MIN_VERSION for overriding the default values
of WindowsTargetPlatformVersion and WindowsTargetPlatformMinVersion in
Visual Studio project files.

The code to determine the default values is moved to qmake feature
files. A common/windows-desktop.conf file is introduced for variables
common to all non-UWP Windows mkspecs.

The package_manifest feature uses WINDOWS_TARGET_PLATFORM_VERSION as
default value for WINRT_MANIFEST.minVersion, and
WINDOWS_TARGET_PLATFORM_MIN_VERSION for
WINRT_MANIFEST.maxVersionTested respectively.

Task-number: QTBUG-53654
Change-Id: I251ec7f9b804c9bc9f7d571f5b43d52b2a2d99d3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-11-16 10:55:16 +00:00
Liang Qi
37d3bc9ad7 Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
2018-11-16 08:10:15 +01:00
Oliver Wolff
299734c3ee Revert "Revert "qmake: Work around MSVC compiler bug.""
The assert still happens on MSVC 2015 64 bit when running
qmake -tp vc -r.

This reverts commit f4169a633b.

Fixes: QTBUG-71228
Change-Id: I05bd3e0677414edb970f07e0555cdc95ce32f592
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 4be8168ff7)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-11-14 07:15:11 +00:00
Qt Forward Merge Bot
0441d959ff Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
2018-11-13 01:00:13 +01:00
Thomas Miller
fbbe8aba9d Add Windows Desktop arm64 target to Qtbase
Allows a qt build to be configured to target arm64 desktop apps cross
platform and build them with nmake.

Change-Id: I99fed12047b45a504a1644201bcc19b18c69f3e6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-11-11 09:05:10 +00:00
Liang Qi
58437fb125 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/serialization/qcborcommon.h
	src/corelib/tools/qlocale_data_p.h
	tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
2018-11-10 11:38:40 +01:00
Oliver Wolff
4be8168ff7 Revert "Revert "qmake: Work around MSVC compiler bug.""
The assert still happens on MSVC 2015 64 bit when running
qmake -tp vc -r.

This reverts commit f4169a633b.

Fixes: QTBUG-71228
Change-Id: I05bd3e0677414edb970f07e0555cdc95ce32f592
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-11-09 21:43:30 +00:00
Liang Qi
bc07958f92 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	.qmake.conf
	qmake/Makefile.unix
	src/gui/text/qtextdocument.cpp
	src/gui/text/qtextdocument.h

Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
2018-11-09 10:34:33 +01:00
Liang Qi
825f988156 Modernize the "textcodec" feature
Also clean up QTextCodec usage in qmake build and some includes
of qtextcodec.h.

Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-07 13:19:54 +00:00
Oswald Buddenhagen
1dd6433b19 qmake: fix .prl file generation for bundles
amends 2b27646146a.

Fixes: QTBUG-70444
Change-Id: I8bd310f5624ea0ac9260c7d9ea0d29b0c9caa077
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-07 10:32:52 +00:00
Paul Wicking
afba8fcc49 Doc: Add description for mode argument of qmake's $$system()
Fixes: QTBUG-70926
Change-Id: Icfd13352cd64053c11502058188041ad16f6c287
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-02 12:40:59 +00:00
Simon Hausmann
e9c45bbddd Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io>
Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-by: Kevin Funk <kevin.funk@kdab.com>
Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Done-by: Simon Hausmann <simon.hausmann@qt.io>
Done-by: Tobias Hunger <tobias.hunger@qt.io>
Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-by: Volker Krause <volker.krause@kdab.com>
Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2018-11-01 11:48:46 +00:00
Frederik Gladhorn
102a919b73 Generate documentation .tags files for all of the docs
This allows others to link to QtDBus and the other libraries/tools using
doxygen.

Fixes: QTBUG-60933
Change-Id: I026895a432a328f224c40cf231ad12d109dc648f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-10-31 08:38:02 +00:00
Kai Koehne
4522468716 qmake: Add support for CONFIG += c++17
The correct name is c++1z. Anyhow, this is easy enough to get wrong,
so make sure CONFIG += c++17 works as well.

Task-number: QTBUG-67527
Change-Id: Iea26b18824b38b1b5170f85987cf5c750b8e10ab
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-10-15 06:47:42 +00:00
Oswald Buddenhagen
473d9a5fc7 qmake: fix the precedence of QMAKE_LIBDIR_POST
it must end up in front of QMAKE_LIBS{,_PRIVATE}, but not of
LIBS{,_PRIVATE} (which are preceded by QMAKE_LIBDIR).

Task-number: QTBUG-61982
Started-by: Liang Qi <liang.qi@qt.io>
Change-Id: Id3de01ee0e9b66af02f79949aeb5a0eabd55363f
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-10-12 18:06:49 +00:00
Oswald Buddenhagen
342b13944c qmake: document {,QMAKE_}LIBS_PRIVATE
Change-Id: I6637d5f57d372f63b3cfaeb28c7e48c940887db6
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-10-12 18:06:43 +00:00
Oswald Buddenhagen
405c73e495 qmake: make sure QMAKE_LIBS{,_PRIVATE} comes after LIBS{,_PRIVATE}
the early merging of LIBS* into QMAKE_LIBS* meant that we could not
interleave them properly. defer the merging until the points of use.

Task-number: QTBUG-70779
Started-by: BogDan Vatra <bogdan@kdab.com>
Change-Id: I890f98016c3721396a1f0f6f149a9e2b37d56d8e
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-10-12 18:06:33 +00:00
Oswald Buddenhagen
2a3695b7e0 qmake: nuke QMAKE_INTERNAL_PRL_LIBS
it's unused now, and just complicates matters. its interaction with
LIBS_PRIVATE & co. has always been a bit shaky. google produces no
public hits outside qt itself, so let's assume it really remained
internal.

Change-Id: I6606bbabd44f1b76d84e97219e155e38d6f1b3a6
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-10-12 18:06:21 +00:00
Oswald Buddenhagen
d30de09000 qmake: remove support for static archive splitting
this was introduced in 2002 supposedly for qnx4, but doesn't appear to
have actually been used ever. remove it, as it's in the way now.

Change-Id: I54dcabb61e1d3609a1e7a9fa4ff4b25509cfdb7a
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-10-12 18:06:15 +00:00
Martin Storsjö
d92c25b1b4 qmake: Fix building with lld with mingw makefiles
lld for coff/mingw doesn't support linker scripts, which qmake used
for passing larger numbers of input file names to the linker.

Instead of using a fullblown linker script for this, just use a plain
response file, which both lld and binutils ld support.

Change-Id: I3aace7902fa6ca861a0a9fe67feaa236e7ea417b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-12 14:01:59 +00:00
Qt Forward Merge Bot
07e9261105 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Iaa438d14357be1bf75bb645cb8d3245947c055b8
2018-09-30 01:00:19 +02:00
Andrew Patterson
857a0d4c51 Fix the /J option for MSVC project generation
Remove the DefaultCharIsUnsigned member and XML property because the
MSVC project file no longer has a specific XML tag for that setting;
instead, the /J option should go directly into the AdditionalOptions
tag.

Task-number: QTBUG-69611
Change-Id: I8f386427b7384ae09553f66193a2c9ea2b98dbc8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-09-27 11:22:40 +00:00
Friedemann Kleint
f4169a633b Revert "qmake: Work around MSVC compiler bug."
The fix was for MSVC2010 which is now no longer supported
and causes a warning:

msvc_vcproj.cpp(217,12):  warning: unknown pragma ignored [-Wunknown-pragmas]
 #pragma optimize( "g", off )

by clang-cl.

This reverts commit 9f54846d95.

Task-number: QTBUG-63512
Change-Id: I395b964d09ac04a7dc852e43d7d95669948eea52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-09-26 05:41:08 +00:00
Oswald Buddenhagen
999d4d5777 qmake: rework .prl filename construction
instead of trying to reverse-engineer it from the final target including
extension and possible bundle path, construct the basename explicitly.
this avoids that we mangle the filename if the actual target contains a
period for some reason.

Task-number: QTBUG-70097
Change-Id: I0bae9f010ab82e258680830250f8e28656f09d67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-30 05:30:17 +00:00
Oswald Buddenhagen
f12fd482f5 qmake: fix file id mapping lifetime management
turns out that flushing the ids together with the ProFile cache was an
abysmal idea, as the latter expires after a few seconds after loading
the project, while references to the ProFiles (and thus the underlying
file ids) are kept for as long as the project stays loaded. the early
flush would cause re-use of the file ids, which would wreak all kinds of
havoc when re-loading projects.

but just ref-counting the vfs class is insufficient as well, as then the
ProFile cache (which expires after a timeout) could outlive all VFS
instances and thus refer to ids which were discarded and later re-used.

so we ref-count, and additionally let the cache instance hold a
reference to the vfs class.

this is sync-up with qt creator; no actual effect on qmake itself.

amends 190aa94be.

Change-Id: Idd4478ffc1c2405b3b83df32fba45b1f687f6a18
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
(cherry picked from qtcreator/d03fb350672d311dccc06f0bcb4da744a3c99745)
(cherry picked from qtcreator/1ddfb443b686ef04cc0e28363308ce70d01f0d73)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-24 12:16:37 +00:00
Liang Qi
8559bf934d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/corelib/global/qconfig-bootstrapped.h
	src/plugins/platforms/xcb/qxcbbackingstore.cpp

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I4af138ffb2f5306373244523768209e8873b2798
2018-08-16 18:48:59 +02:00
Joerg Bornemann
f2668c6b43 qmake vcxproj generator: Fix extra compilers for single configs
For single config mode (no debug_and_release) extra compilers wouldn't
get added to the vcxproj file.

Single config mode creates a temporary project, and that was incomplete.
Multi config mode, on the other hand, directly operates on the "real
data" and wasn't affected by this problem.

Task-number: QTBUG-69769
Change-Id: I9cd942e43d80adbeac9a3c8fbe1a5766bc9645a0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-08-09 06:21:01 +00:00
Alessandro Portale
a959a0e206 qmake: Apply modernize-use-nullptr
Use nullptr instead of 0.

Change-Id: Ib3120b9c424a274a2d4dd4c42ec5d7cd5bdead65
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-08 17:30:32 +00:00
Alessandro Portale
182aca8487 qmake: Apply modernize-use-override
Add overrides to functions, except for destructors.

Change-Id: I6e4640aa95a5c97d6bd6f6d8692d3290c421344e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-08 17:30:23 +00:00
Alessandro Portale
24115f5a9c qmake: Avoid comparison of values with different enumeration types
A switch statement using enumeration type midlErrorCheckOption as
condition had an enumeration value from type midlStructMemberAlignOption
as a case label. This had only coincidentally the intended effect, since
the intended value (midlErrorCheckOption::midlEnableCustom) and the
actually used one
(midlStructMemberAlignOption::midlStructMemberAlignOption) have both
the value 0.

Change-Id: I73b337f23e733a1a6fb80517e29365e01838238a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-08 17:30:12 +00:00
Joerg Bornemann
7dc930d400 qmake vcxproj generator: Fix compilation of generated C++ sources
Generated C++ source files with extensions other than .cpp would not get
compiled, because the code ignored all other C++ source extensions like
.cc and .cxx.

Fix this by respecting the value of QMAKE_EXT_CPP and QMAKE_EXT_C.

Task-number: QTBUG-69770
Change-Id: I097dfef6920e353a351c97891cdbfdc9a859815f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-08 05:12:44 +00:00
Qt Forward Merge Bot
053e7cce79 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf
	src/corelib/doc/src/objectmodel/signalsandslots.qdoc
	src/plugins/platforms/cocoa/qcocoamenuloader.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	tests/auto/gui/image/qimage/tst_qimage.cpp

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
2018-08-07 17:44:51 +02:00
Oswald Buddenhagen
a09a28879e qmake: improve the fake project
qt creator's clang code model is a bit more picky than the old one, so
we need a project that approximately works.

while we're at it, inline qmake.pri, add some missing files, and
beautify the source lists.

Change-Id: I87ca1db2ee3e55ea08e4c23f7913e882ab44fd21
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-08-06 10:25:50 +00:00
Oswald Buddenhagen
9d4d05ec53 qmake: don't escape colons in dependency paths on windows, after all
amends 7c34e0a7b4.

Change-Id: I2ecdf0a450337e667f55af09b3de79fb47e05428
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-08-02 15:15:30 +00:00
Kai Koehne
780dc2291b Fix builds with some MinGW distributions
Some distributions do not define MINGW_HAS_SECURE_API globally,
resulting in methods like wgetenv_s not being declared in the
headers.

This is probably to keep compatibility with Windows XP. Anyhow,
we don't support Windows XP anymore, so we can safely add the
define.

Note that this is not necessary for the mingw-builds distro,
which is the only one we test and support. Anyhow,  I don't
see any risk in adding these for other distributions.

Diff was provided by Philippe Dunski in the bug report.

Task-number: QTBUG-67443
Change-Id: I3a64b11541fe95e527ed44bbf8ad94469d457d3d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-02 07:10:00 +00:00
Edward Welbourne
cf2d59bfe8 Merge "Merge branch '5.11' into dev" into refs/staging/dev 2018-07-31 11:34:23 +00:00
Edward Welbourne
23c9d4c98f Merge branch '5.11' into dev
Conflicts:
	qmake/library/qmakebuiltins.cpp
	src/plugins/platforms/windows/qwindowstabletsupport.h
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

Done-With: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I000b0eb3cea2a5c7a99b95732bfdd41507cf916e
2018-07-31 13:33:14 +02:00
Tor Arne Vestbø
8cea3ec8ce qmake: Harden logic for handling the -o option
We now treat -o foo/bar/baz as a request to generate the output in the
foo/bar directory with baz as the output name, or if foo/bar/baz is already
a directory, in the foo/bar/baz directory with the default output name.

We take care to handle generator specific directory structures, so
that the project directory does not get merged into OUT_PWD. This is
done in runQmake(), before parsing the project file, so that OUT_PWD
will be correct during project parsing. The individual generators are
then passed the filename relative to the final output directory.

Each generator now also makes sure to add the right project suffix
to the output file, so -o foo will result in foo.pro or foo.vcproj,
instead of just foo.

Task-number: QTBUG-44408
Change-Id: I26990cec0c0458bee2b88dbb86322617a85f54b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-31 10:13:31 +00:00
Tor Arne Vestbø
f1243f6d44 qmake: Emit warning when regenerating Xcode project during build
Makes it a bit more clear why all the Xcode settings were lost.

Task-number: QTBUG-45113
Change-Id: I3b19edb02a24673f56e77d3a1fb7cc76584c73fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-30 19:41:15 +00:00
Thomas Miller
0ef66e98cc Fix qtbase build for MSVC 2017 15.8
Fixed breaks caused by MSVC 2017 15.8 fixing std::aligned_storage.

Change-Id: I5adea18c184e34bbdc3bd294d034b97383ef08a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-30 18:29:10 +00:00
Kai Koehne
01d2f35b69 qmake: Add support for running lrelease
CONFIG+=lrelease enables that all .ts files in
TRANSLATIONS or EXTRA_TRANSLATIONS are compiled by
lrelease.

EXTRA_TRANSLATIONS is a new variable that is only
processed by lrelease, but not lupdate - this
is useful for translation files that are supposed to
be empty, because they match the language of the
original translation sources.

If embed_translations is also set, the generated .qm
files will be made available through the Qt resource
system under :/i18n/. Alternatively, the user can
specify an installation target by setting
QM_FILES_INSTALL_PATH.

Note that relative paths in TRANSLATIONS are not taken
into account. That is,

  TRANSLATIONS = component1/de.ts component2/de.ts

will cause a conflict.

[ChangeLog][qmake] New CONFIG options lrelease and
embed_translations were added. CONFIG+=lrelease does
run lrelease on translation files listed in TRANSLATIONS
and EXTRA_TRANSLATIONS. CONFIG+=embed_translations does
include the generated .qm files as resources under
:/i18n/.

Change-Id: I94db5b8431d07b24f59b2c332ede91450f9c0c58
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-28 14:43:28 +00:00
Kai Koehne
cd542b0094 Doc: Fix typos and grammar in qmake variable reference
Change-Id: I2e039ed1383c9d7fec61b378c5ca8e99fbbf1911
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-27 14:29:11 +00:00
Kai Koehne
f493324066 qdoc: Fix CONFIG documentation table
Amends 591edbb11c

Change-Id: Ic31d733a1f2d386daa05afa865cb61a987f45578
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-25 07:37:19 +00:00
Oswald Buddenhagen
80dea66424 qmake: don't drop non-existing files from .depend_command output
this allows for dynamic generation of the dependencies.

Task-number: QTBUG-61267
Change-Id: If5b8aed6b9e4bde189cc3ba6a5f13dcf8def3a1e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-25 06:53:56 +00:00