In qmake it's done for all qmake projects, in CMake we lean on the
safe side and apply it to building Qt itself. User CMake projects can
then choose to add it themselves.
Task-number: QTBUG-85992
Change-Id: I51919f947d43ffd9925e3d2837dcad17e480367d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Introduce new CMake variables and map
-D to QT_EXTRA_DEFINES,
-I to QT_EXTRA_INCLUDEPATHS,
-L to QT_EXTRA_LIBDIRS,
and -F to QT_EXTRA_FRAMEWORKPATHS.
Those variables only affect the Qt build, not user projects.
Fixes: QTBUG-85878
Change-Id: I229df2eed1505a2619068d0d32975962b052569a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Most of the time lld just gets stuck (deadlock) waiting on some
mutex, thus failing integrations.
Amends 64c111e10f
Task-number: QTBUG-85911
Change-Id: Id73bf967a7aeb0e0cbccfaafe056b325c8711f82
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This new function is meant to be used where load(qt_app) is used.
It delegates functionality to qt_add_executable, while handling
some additional behavior via a finalization function (mostly handling
of macOS Info.plist files and icons, as well as Windows icons and
resource files)
It uses a new PlatformAppInternal interface target.
Task-number: QTBUG-85757
Change-Id: I1a2d5851b137fcd4a6323e0e06fb154f91619800
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
gcc doesn't report warnings for final methods since version 9.2:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010
Change-Id: I7152351aac0e3bad86d777e119f25137ef97ec6f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Apple deprecated the entire OpenGL API in favor of Metal, which
we are aware of, so we don't need to see the warnings when building
Qt.
Instead of applying the silencing globally for all Qt consumers,
both internal and external, we now limit the silencing to Qt itself.
That means user code that explicitly uses any of the deprecated APIs
will see the warnings. Note that this does not apply to merely using
any of the Qt OpenGL APIs. The user has to explicitly use the platform
APIs that have been deprecated.
The warnings need to be disabled on a build system level, so that
that they are passed as -D flags on the command line. If the defines
were done in Qt headers (qguiglobal.h e.g.), they would require the
user to always include this header before any of the Apple headers.
Change-Id: I3f2a2a5211332a059ad4416394251772c677fdcb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Building an iOS app with qmake failed because Qt itself was not built
with bitcode enabled.
Enable building with bitcode.
Make sure qrc resource files and bundled 3rd party libraries also
build with the regular Qt module flags and thus with bitcode enabled.
As a consequence gc_sections has to be disabled for UIKIT platforms.
Task-number: QTBUG-82581
Task-number: QTBUG-84781
Task-number: QTBUG-85240
Change-Id: I15fe668725a139c02f2a32a5db849b46d4ce325c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
In qmake land the define is set in mkspecs/common/macx.conf which
means it should be public for all Qt consumer apps as well, not just
internal targets. Make it so.
Amends 17be43c58e
Task-number: QTBUG-83929
Change-Id: I9f9d7dfca24b54977cb8364723c3618d3fec2e73
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The large file flags in qmake land are set in the
mkspecs/features/unix/largefile.prf file, which is loaded by qmake
when a CONFIG += largefile entry is written by configure into
qmodule.pri.
This essentially makes them global flags for all private Qt targets
because qmodule.pri is a global file loaded load(qt_build_config)
Thus assign the flags onto the PlatformCommonInternal target instead
of the PlatformModuleInternal one.
One peculiarity though is that in qmake land these flags are also
applied when building examples as part of the main Qt build. This
is because qt_build_config loads qmodule.pri even for an example,
because qmake sees it as part of the overall Qt build.
The flags are not applied by qmake if the example is built in
a different standalone build dir not part of the Qt buil dir.
We don't do that in the CMake build, and thus examples will never
have those flags.
Task-number: QTBUG-83929
Change-Id: If653a669b4835aadd1de84acb477c375ab523909
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Needed to avoid linker warnings transformed into errors, when linking
QtWebEngine with qmake mixing.
ld: warning: linking against a dylib which is not safe for use in
application extensions:
The flag is added to libraries and plugins, unless opted out.
CMake equivalent of 944110089d
Task-number: QTBUG-83929
Task-number: QTBUG-75666
Change-Id: I3e9acca4712c9a266bf54c6e35e2fd2c0096692b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
And enable the same default when building Qt itself (it's implicit).
Allow opting out on a target-by-target basis, by using the public
qt_disable_utf8_sources() API call.
Change-Id: Ifc19a744d57b96b1c74a6926a0c6628c2a820464
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Otherwise when applied to bundled 3rd party library C files,
the MinGW build fails when compiling src/3rdparty/md4c/md4c.c.
Change-Id: Ia522b10aa69aa15f239d20c65e31c84edbccee6d
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Enable sse2 and fpmath for modules when appropriate, the logic
is a port of the code in mkspecs/features/qt_module.prf.
Fix qdrawhelper.cpp to always be compiled when using GCC with a
special case. pro2cmake.py failed to handle the source subtraction
correctly.
Fixes: QTBUG-83791
Task-number: QTBUG-75578
Change-Id: Ibe32a250b266d580ad21f6c55f09fd03a14ceb82
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Add -Wno-error=format-overflow. This is similar to what is done in
qt_common.prf, however we don't turn the warning off completely.
For now at least.
Change-Id: I93c20064759dea43309c3a17de4d733ede9ca2cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch adds missing linker flags for MSVC in order to match
qmake's msvc-desktop.conf.
Change-Id: Ieb1206dae4517e8d9f36175f8fcebccd30e52d01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch adds a couple of missing compile flags that are defined in
mkspecs/common/msvc-version.conf and mkspecs/common/msvc-desktop.conf
that were not yet ported to CMake.
Change-Id: I9ef0ef71cb0c063699fba4c067e90f6515169baf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Prior to this patch QT_NO_DEBUG would not be correctly set for
generators which support multiple configurations such as Visual Studio
and XCode.
This patch also applies the define to all executables, which was
previously missing.
Change-Id: I16a911d15217a62093c68ba2b4c2545cdb8df1e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Tested locally with the following configurations:
- iOS device builds (arm64)
- iOS simulator builds (x86_64)
- iOS simulator_and_device builds (fat arm64 and x86_64 archives)
All iOS builds currently require a custom vcpkg fork which contains
fixes for building the required 3rd party libraries.
qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2
have also been tested to build successfully.
simulator_and_device builds are also supported, but require an umerged
patch in upstream CMake as well as further patches to vcpkg.
Task-number: QTBUG-75576
Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Unfortunately not all repositories are marked as warning_clean
in their .qmake.conf files. For instance qtconnectivity and
qttools are not warning clean. Therefore we need to skip
warnings_are_errors flags on all targets created in that repository.
Add support for skipping the warnings are errors flags, by setting
a QT_SKIP_WARNINGS_ARE_ERRORS property on a target, and use that
within a generator expression with all the accumulated flags.
To mimic behavior of qmake, and set the property on all targets
created by add_qt_module, add_qt_plugin, etc, one simply needs
to set the QT_REPO_NOT_WARNINGS_CLEAN variable in the
repo project CMakeLists.txt.
Change-Id: Ib5a487af6601ae1519a0988a89f8083f94f92267
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The current state of qtbase is confirmed to be built with no warnings
when using up to Xcode 9.2, as per the check in
mkspecs/features/qt_common.prf. Add the same check for the CMake
build.
Change-Id: I0c2409ece048e93fba29c41a8bd053dd112949bd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
All the other PlatformModuleInternal, PlatformPluginInternal,
PlatformToolInternal target will depend on the common one.
Also add the QT_NO_DEBUG definition when the build type is not Debug.
This fixes the lookup of the Qt platform plugin on macOS, which
uses a "_debug" prefix in the plugin name depending on if the
QT_NO_DEBUG definition is present or not.
This is the same as it is done in mkspecs/features/qt.prf.
Change-Id: I82cf461d44b8a3b3c5dc2b2d9f25baa246fc1e4b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In qmake land warnings_are_errors is only enabled for specific
MSVC versions, ending with MSVC2015. Presumably the warnings have not
yet been fixed for newer MSVC versions, so we stick with the same
status quo for now.
Change-Id: Idc3741d39c888f77ed324a5eb8c654416591785f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In qmake land, the largefile.prf feature is automatically loaded due
to 'largefile' being added to CONFIG via the equivalent feature.
The prf file is in the 'unix' subfolder though, which means that qmake
doesn't load it on Windows.
We need to do the same, otherwise we get build errors due to the
define being checked in ZLIB headers, and selecting an invalid code
branch on Windows.
Change-Id: Ibe9202a639754927262bb8aaa28289934f2e23ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Move flags/options that we use for modules from add_module to the new
platform module target.
Change-Id: I89e414690336dcd37253432fe5116226d1c8dd82
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Link to them from add_qt_module/plugin/tool
This way we set the warnings_are_errors flags just once
and also non-qtbase modules get them
Change-Id: I2b65a81694aaebdd7c886249f217c11f79492bad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>