Linking with a framework suffix to pick up the debug version of
libraries doesn't work as long as the dependencies picked up from prl
files are not rewritten to also include the suffix. The result is that
we end up loading both release and debug versions of the Qt libraries.
Use the target environment (target_wrapper.sh) to set the image suffix
instead, which means 'make check' will automatically work.
Change-Id: I60b0840760f68e579c270245d394e1dd609a0ebb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The failure mode of this behavior is worse than the surprises that the
non-explicit library dependency chain has, so it should be opt-in.
This reverts back to the behavior in Qt 5.11, but lets our tests
opt in to the feature.
Fixes: QTBUG-71724
Change-Id: Iede11f02d978b637324ddf71d29e7c99fe3ee99f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
When Qt is configured for both debug and release, and frameworks are
enabled, we produce two dynamic libraries inside each framework, eg:
QtCore.framework/QtCore
QtCore.framework/QtCore_debug
When building an executable against these frameworks, we pass -framework
QtCore, and the resulting executable will have its LC_LOAD_DYLIB load
commands pointing to e.g.:
@rpath/QtCore.framework/Versions/5/QtCore
When running the executable, the dynamic loader will load the dynamic
library dependencies based on these load commands.
By setting the DYLD_IMAGE_SUFFIX environment variable at runtime to
'_debug', the dynamic loader will prefer the debug versions of each
library inside the frameworks.
Unfortunately the use of an environment variable to choose debug or
release versions leaves room for mismatches between the executable
and the libraries that are loaded. An executable built in debug
mode will at runtime pick up the release versions of the Qt libraries
unless the DYLD_IMAGE_SUFFIX has also been set to match the build
configuration of the executable.
This results in confusing situations such as building your application
in debug mode, and then stepping into Qt code but not getting any
symbols. Qt Creator has an option to run the application with
DYLD_IMAGE_SUFFIX set, but this is not enabled by default due
to the startup cost of loading the Qt debug libraries.
More critically, it results in tests failing when the tests are using
QTest::ignoreMessage to ignore warnings produced by Qt, and these
calls are ifdefed (correctly) inside QT_NO_DEBUG, as the test
(built in debug mode) will then expect warnings from Qt, but those
warnings are not emittet, as the test is run against the release
version of the Qt libraries.
To mitigate this mismatch, we now link the Qt frameworks using
an explicit suffix, just like we would for no-framework builds
on macOS, for debug and release builds on Windows, and for
normal builds on other Unixes, leaving the dependency chain
for the application predictable:
@rpath/QtCore.framework/Versions/5/QtCore_debug
This also conceptually matches how Xcode builds applications and
frameworks, where it never relies on DYLD_IMAGE_SUFFIX, and instead
uses two separate build directories, one for each configuration.
The change means that Qt Creator will always load the Qt debug
libraries if the application is built in debug mode. For Qt
development this is a good thing, as you expect to be able to
step into Qt code. For our users, the added startup cost can
be mitigated by shipping our binary packages as release-only,
but with separate debug info enabled.
Change-Id: Ib9f1f2dab90ed00b9fb011200e3a69c71955e399
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
otherwise the project would need to clear QT despite using
qtHaveModule() in requires() (or REQUIRES=).
Task-number: QTBUG-65106
Change-Id: I568202214c8eafcdbe2d0e253b18f0e171293aff
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
move the code before the linking of qt modules - dependency resolution
would re-order them anyway (or static linking would fail).
on the way, fix up the coding style and rename some variables.
the code to de-duplicate/normalize QTPLUGIN is pulled ahead, which means
that the automatic plugin importing wouldn't make a mess of it any more.
but this is mostly legacy anyway.
Change-Id: Id135470d027f5d84b7f30531425a65efa230f278
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
plugins may pull in additional qt modules which may require additional
plugins in turn.
Change-Id: I22264b39c1397666b2dc9079048ed1fc64aa84d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
while we already linked the plugins for our own private deps, we failed
to do so for our transitive deps.
this also fixes linking qml plugins if qml is linked only indirectly and
privately.
the code for setting up rpath-link is slightly refactored as a side
effect, with no functional change.
the code for setting up rpath now also sees the longer list of
dependencies, but that's irrelevant, as qtcore always ends up among the
direct deps anyway iff any non-bootstrapped modules are used.
Change-Id: I90dca81a2836c6191ce5d092e16bf7660ee820bc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
static plugins must be actually linked into the target whenever it is
not a static library itself.
apart from fixing qml plugin linkage, this also provides a more generic
fix for the already fixed linking of activeqt controls.
Task-number: QTBUG-28215
Task-number: QTBUG-55279
Change-Id: I9661369bf3dfc6bcf3a5ed563e6716eb3ef6e76e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
static builds of qt have been embedding their qml files via the qt
resource system since qt 5.7, so the code which attempted to deploy them
into mac bundles (introduced in qt 5.2) is useless nowadays.
Change-Id: I830cd2b660f7cab42a46ec8e002a42d9d299b528
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
the code was broken since 5.0, as it still hardcoded the version number
4 for the plugin basenames.
wince is not supported any more, so there is no point in trying to
restore the code to function.
at a later point, we'll make QTPLUGIN universal enough to cover both
static and dynamic deployment.
Change-Id: I0911ce4aff7a799dd471d6218e046f13dca6d49e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
excise knowledge of QTREPOS from qt.prf - this is a private variable of
the qt build system which the public functions should not know anything
about.
instead, move this handling to a function in qt_build_config.prf (where
QTREPOS comes from in the first place), and call it from qt_app.prf and
qt_example_installs.prf (which should be the only consumers within qt).
qt.prf now also checks that the qml install dir actually exists, which
is not the case during a modular prefix build of qtdeclarative.
not really incidentally, this fixes modular static builds of
qtdeclarative.
Task-number: QTBUG-57308
Change-Id: I31465b9cd400483264fc236934c6f9f26a5fdd73
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
QTPLUGIN.<foo> is better used with valid variable names, which is not
the case when the plugin type contains slashes (plugin subtypes) or
dashes (just so). normalize these chars to underscores.
Change-Id: Icc93d952b93fef342e2fc93f20e9c5dd010dd734
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
when a module makes an external dependency part of its api, the users of
that module need to know the include paths (and possibly defines) of
that dependency, and also need to link to it explicitly if they want to
access symbols from it directly.
this patch implements this via the usual qt module pri mechanism.
limitation: the external library definitions are in the private pris,
so technically a public module is not allowed to make its external
dependencies public. we don't have (and don't anticipate) such a case.
Change-Id: I2dbbdcfcfc1b200acae151a969976cd668e24f89
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
5971b88e is not needed in new configure.
This merge also reverts "fix QMAKE_DEFAULT_*DIRS resolution with
apple SDK", 2c9d15d7, because it breaks iOS build with new
configure system.
Conflicts:
mkspecs/features/default_pre.prf
mkspecs/features/mac/toolchain.prf
mkspecs/features/toolchain.prf
src/dbus/qdbusconnection.cpp
src/plugins/sqldrivers/mysql/qsql_mysql.cpp
src/sql/drivers/mysql/qsql_mysql.cpp
src/widgets/widgets/qmenubar.cpp
src/widgets/widgets/qmenubar_p.h
tools/configure/configureapp.cpp
tools/configure/environment.cpp
tools/configure/environment.h
Change-Id: I995533dd334211ebd25912db05b639d6f908aaec
Use the new qtConfig macro in all pro/pri files.
This required adding some feature entries, and adding
{private,public}Feature to every referenced already existing entry.
Change-Id: I164214dad1154df6ad84e86d99ed14994ef97cf4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
get rid of the entirely superfluous stock "Aborting." messages -
the event triggering the exit has already reported the problem.
Change-Id: Ib9dfb9e4212f60eceb2ea432cdf56c5a8afe9d65
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Conflicts:
qmake/library/qmakebuiltins.cpp
qmake/library/qmakeevaluator.cpp
qmake/library/qmakeevaluator.h
qmake/project.h
QMakeEvaluator:
* evaluateConditional(): one side changed return type, the other
changed a parameter type.
* split_value_list(): one side changed a parameter adjacent to where ...
* expandVariableReferences(): ... the other killed one overload and
changed the survivor
src/corelib/io/qlockfile_unix.cpp
One side changed a #if condition, the other moved NETBSD's part of
what it controlled.
src/corelib/tools/qdatetime.cpp
One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the
other moved it from the private class to the public one, in the midst
of the "short date-time" optimization, which confused diff entirely.
One side changed a QStringLiteral to QLatin1String, the other rewrote
adjoining code.
src/network/kernel/qauthenticator.cpp
Both rewrote a line, equivalently; kept the dev version.
src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
One side changed #if-ery that the other removed.
tools/configure/configureapp.cpp
One side added a check to -target parsing; the other killed -target.
tests/auto/testlib/selftests/expected_cmptest.lightxml
tests/auto/testlib/selftests/expected_cmptest.teamcity
tests/auto/testlib/selftests/expected_cmptest.txt
tests/auto/testlib/selftests/expected_cmptest.xml
tests/auto/testlib/selftests/expected_cmptest.xunitxml
Regenerated using generate_expected_output.py
I note that quite a few other expected_* come out changed, now.
There was no git-conflict in
src/widgets/kernel/qformlayout.cpp
but it didn't compile; one side removed some unused methods; the other
found uses for one of them. Put FixedColumnMatrix<>::removeRow(int)
back for its new user.
Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
Conflicts:
qmake/library/qmakeevaluator.cpp
One side changed the iterator to use ranged-for, the other changed its
body; they only conflicted because the latter had to add braces around
the body, intruding on the for-line. Trivial resolution.
Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
the whole point of the check is ensuring that the message is printed
only once for each sub-project, so !build_pass alone is fully adequate.
Change-Id: Ib8f821ead6709efc9bfa935e1d05f8caba02a814
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
So far no capabilities (but internetClient for Windows 10) were added by
default, which forced developers to always manually edit the
WINRT_MANIFEST.capabilities(_device) property.
This allowed to leave out non-required capabilities and keep the created
manifest clean, examples being microphone for multimedia.
However, this also breaks first user experience as deeper knowledge
about this topic is required. Furthermore this is inconsistent with
other platforms like Android, where all capabilities are set by default
and developers need to edit the manifest manually in any case.
With this change, modules can define the capability set to enable all
features in the module. If developers want to disable some again, they
need to adapt the generated manifest. From our experience this needs to
be done in any case, latest at publishing stage when the store
manipulates the manifest.
Task-number: QTBUG-38802
Change-Id: I6d522268ee0afbfa00a30dbdd5e6ec9f415bebf3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The platform has been removed in Qt 5.7.
Change-Id: Ie768b5ffbe60270c27b4a670dcf580ea361cb361
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This reverts commit c4ecb81d6d.
Hard-coding the library suffix into the linker flags was wrong. The
library suffix is handled at runtime with DYLD_IMAGE_SUFFIX, set
as part of the Xcode scheme or during debugging in .lldbinit.
Change-Id: I11907b2755f7f187fb6fa18202813fde9ada4354
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This is necessary for combined device and simulator builds on Apple
platforms (iOS, tvOS, watchOS) to link properly.
Change-Id: I21e70806643b10f429945d3020995dc94fa5c612
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
save the actual library/framework name and framework paths in the .pri
file instead of computing them again at use time in qt.prf.
qt_no_framework_direct_includes inherently requires a use-time decision,
so this ugliness remains.
Change-Id: I09b2775e7d8e1d52e3af0d663e1babde10ae4814
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The files are automatically generated, so that's where they
belong. This makes a small cosmetic difference when generating
Xcode projects, since then the files will be grouped under
a different folder in the project explorer, separate from user
sources.
Change-Id: Ic2599ccb3008635e76ae467eec80f2b9e5ca838e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
qt_framework and {app,lib}_bundle imply darwin, so there is no point in
testing for it.
Change-Id: I9fe48c26c8e271a5575b17e92df8674d3c3a3204
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
the check whether a module depends on itself should be done by the code
which *builds* modules, not which *uses* them.
the check whether a plugin tries to use itself seems kinda pointless in
the first place, so just remove it.
Change-Id: I89b357dae7d7979d131b6824f197e7088047272f
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
... and make use of it in qt.prf.
[ChangeLog][qmake][Unix] Added support for relative paths in
QMAKE_RPATHDIR.
Note that this technically breaks backwards compatibility, as relative
paths were previously silently resolved against $$_PRO_FILE_PWD_. This
was not documented and seems rather useless, so i'm not worried.
Change-Id: I855042a8962ab34ad4617899a5b9825af0087f8a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
these were necessary to suppress the appending of the qt major version
to the library name when reading .prl files. this has outlived its
usefulness, as the .prl files now contain the full library name.
additionally, the overrides would break the use of qt if the .prl files
were not shipped, as zero lost its special meaning as "none".
Change-Id: I9f028c17fc0428cb546a4a26ee209febff32da5e
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
there is no particular reason to have them in qt_functions.prf any more,
while the separation made the code harder to follow.
Change-Id: Ie44c9784358f382f7bc863b421ff5b440211d66f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
there is no particular reason to have it in qt_functions.prf.
Change-Id: I88ed1ea937a9a88a4625a6de7bcd3a29957560da
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
the addition of qt's rpath belongs into qt.prf - even on mac.
so consolidate the two implementations.
as a nice "side effect", we get relative rpaths also on linux.
another "side effect" is that we don't unnecessarily add the qt rpath to
qt modules also on linux.
the qt rpath addition mechanism should not be responsible for setting
the policy who gets a relative rpath, so move the logic to higher-level
callers.
Change-Id: I52e8fe2e8279e7b1ac25fae758867a5cb1cafcf8
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>