Commit Graph

1804 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
607338f98f Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I83f6ed9480bf21020ce7a9431010d87a88df84a1
2019-03-02 01:00:08 +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
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
64085d9b2f Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9e7cb1b131b7b216aad8ed1b1536669fd1557c21
2019-02-22 01:00:27 +01:00