Commit Graph

38 Commits

Author SHA1 Message Date
Fabio Falsini
88ab9e1800 Change android target SDK version to 29
Play Store now accept only app with target
SDK version set to 29 or above

Pick-to: 6.0
Change-Id: If38f20c88fd6b0e6f29939cdf3d2eb793c0e1489
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-11-26 20:05:41 +01:00
Orgad Shaneh
04739ce4b4 Qmake: Share QMAKE_LINK_OBJECT_SCRIPT definition
It is only used by default on Windows, but can be enabled by setting
QMAKE_LINK_OBJECT_MAX.

The current file name is .project_name.

Use a sensible file name on this case.

Change-Id: Ic250d024e5feca739027c79a6e285d616234c4ea
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-06 16:44:11 +03:00
BogDan Vatra
519ea72108 Android: Bump gradle (plugin) versions
Move min & target sdk from AndroidManifest.xml to build.gradle

Fixes: QTBUG-70817
Change-Id: Id9bb9825a3232587e0255b2d3d6f0273c5f9b66a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-03-04 18:02:35 +00:00
Andy Shaw
b274f656b8 Be able to create a response file for other generators too
When building an application for Android on Windows it is possible that
the command line will be too long when doing the link step. So the code
for generating a response file is moved to MakefileGenerator so it can
be used by the other generators easily. The same variables used by
MinGW can be used elsewhere then.

Fixes: QTBUG-71940
Change-Id: I6c331d12e9541a90a4a95e0154d0ea1c056489bc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-11-06 18:14:17 +01:00
Christian Romberg
6acab25f97 Remove GCC-style PCH directives from android-clang mkspec
As described in QTBUG-72404, the android-clang mkspec has the gcc pch
style hardcoded for no reason. This change removes the respective lines.

[ChangeLog][qmake][Android] Remove gcc-style PCH directives from the
android-clang mkspec.

Fixes: QTBUG-72404
Change-Id: Iad42651e25ecce08eda7aa5fa8bbf531c9497896
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-25 07:04:57 +00:00
BogDan Vatra
86a0f1cfd7 Add build-id flag
This flag is needed by LLDB & simple perf tools to locate the right binary.

Change-Id: Iffa1b0678663cfb9d1d699da5ad6fe672863918c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-24 12:30:53 +03:00
BogDan Vatra
c28b881c98 Android: Use LLVM tools where possible
Properly set CROSS_COMPILE qmake variable

Fixes: QTBUG-77890
Change-Id: I73e22d0f936d35c373c064d30ea8d92005d79b2c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-29 09:45:37 +03:00
BogDan Vatra
3db14b5bd3 Say hello to -android-abis configure param
This configure parameter is useful to compile Qt only for a selected ABIs.

The old parameter, -android-arch, does the same thing, it's kept for compatibility.

[ChangeLog][Android] -android-abis configure script parameter useful to compile Qt
only for a selected Android ABIs.

Change-Id: I1f418c7e0914dd83b98d763e8cd8c09841e20fdf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-28 12:36:34 +03:00
BogDan Vatra
5bb178c479 Say hello to Android multi arch build in one go
Multi arch build in one go is need to support the new .aab packaging format.

By default the users apps are built for all Android ABIs: arm64-v8a armeabi-v7a x86_64 x86
The user can pass ANDROID_ABIS to qmake to filter the ABIs during development,
e.g. qmake ANDROID_ABIS="arm64-v8a armeabi-v7a" will build only for arm ABIs.

[ChangeLog][Android] Android multi arch build in one go,
needed to support the new .aab packaging format.

Change-Id: I3a64caf9621c2a195863976a62a57cdf47e6e3b5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-26 12:59:15 +03:00
BogDan Vatra
9b14950ff6 Android: Update clang mkspecs
Follow Google's BuildSystemMaintainers doc to simplify (a lot) the clang support
It is needed to support future NDK releases painlessly.
Also remove old workarounds.

[ChangeLog][Android] Android depends on NDK r20+

Change-Id: Ib4c07fc71e0f5a264d804b0b3baa18ff79d07630
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-22 16:32:47 +03: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
Qt Forward Merge Bot
2a9cf3aeab Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I53a50669face6f68ddc046fd2102de8c1f888b4b
2019-06-14 01:00:09 +02:00
BogDan Vatra
0676645318 Android: Fix build with NDKr20
In NDK r20 clang adds -lc++ library automatically which leads to link fails.

[ChangeLog][Android] Fix NDK r20 linking.

Task-number: QTBUG-76293
Change-Id: I6675180a3555d1ad9047d7a9ce1c03333cf0ab35
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-13 07:14:54 +00:00
BogDan Vatra
854156dd07 Android: Nuke mips architectures
Mips archs were removed from Android NDK long time ago.

Change-Id: Icf64a1e2cfbe3fe7307c7898b14fd199d9eeaad3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-05-06 08:01:04 +00:00
BogDan Vatra
74e04d6ace Android: follow official android flags for cmake
Update our cflags and lflags with the ones found in android.toolchain.cmake

Fixes: QTBUG-73274
Change-Id: Id9fd9bf04df959239abd3100090a1485e872b2f0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-02-07 09:02:17 +00:00
BogDan Vatra
6fdf398ab4 Android: Prepare for the worst, when the NDK will remove all GNU tools
In NDKr18 Google removed GCC, most probably the massacre will not end
there and they will remove all GNU tools, so we need to start using LLVM
ones.

This patch still keeps the compatibility with GNU tools if the Qt was
built with android-g++ mkspec.

Change-Id: Ibe1979577e08ce63604d55fc5bbd5f64b3737675
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-19 11:45:20 +00:00
BogDan Vatra
56f949ad3c Android: fix compile with NDK r18+
In NDK r18, libc++.so was renamed to libc++.so.XX where XX is the Android
API level.

[ChangeLog][Android] Fixed build issue with NDK r18+.

Task-number: QTBUG-70631
Change-Id: Id0d2955648197e3054e3c69263b5a90d57964f6c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-10-12 18:06:38 +00:00
Liang Qi
1fa5d83ad2 Revert "Android: Compile with NDK r18 + clang"
This broke the build for qtlocation.

This reverts commit 176a216f4f.

Task-number: QTBUG-70779
Change-Id: Ifd8419ffb88c1a9009319f39b11b4529b143477e
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2018-09-28 13:46:11 +00:00
Eskil Abrahamsen Blomfeldt
176a216f4f Android: Compile with NDK r18 + clang
In NDK version r18, the libc++.so file we used for clang has been
removed. However, in r17 this was actually just redirecting to
libc++_shared.so, which is still available in r18, so we can
link directly to that instead.

[ChangeLog][Android] Fix build issue with Android NDK r18 and clang.

Task-number: QTBUG-70631
Change-Id: I658c0cabf49f27a47f38305de3c86067c8b18b25
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-09-25 19:29:54 +00:00
Allan Sandfeld Jensen
9f54745362 Use optimize_size instead of duplicating similar logic
The android mkspecs had their own way of doing the same as optimize_size

Change-Id: Id05822df6bdeb8b3aafada2901bd61530c490fe9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-04-14 17:23:25 +00:00
Vyacheslav Koscheev
a4e67a303b Android: add option -mstackrealign to clang-x86 mkspec
Task-number: QTBUG-66770
Change-Id: I5e8ced0fa60c67d7908f21e5c486fea0d7a50004
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-03-06 03:17:24 +00:00
d3fault
1a4cc8d57b Add QIODevice::NewOnly and QIODevice::ExistingOnly OpenMode flags
When QFile::open is called with the NewOnly flag, the call will
fail if the file already exists. As usual, if the file does not exist,
it will be created. Like QTemporaryFile, there is a guarantee from
the operating system that you are not accidentally creating a new file
on top of an older file. When QFile::open is called with the
ExistingOnly flag, the call will fail if the file does not exist. The
ExistingOnly flag only provides new functionality when used with the
WriteOnly flag. For ReadOnly it provides no change in functionality,
as ReadOnly by itself already never creates.

Task-number: QTBUG-52244
Change-Id: I8e3206728f245f95172c225bf297023fb078fc6d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-17 04:32:47 +00:00
Thiago Macieira
4a44bd6cdc Stop including net/if.h from qplatformdefs.h
I need to include linxx/if.h from elsewhere and these two files conflict
by defining the same types (struct ifreq, struct ifmap, struct ifconf,
etc.)

Change-Id: I0a103569c81b4711a649fffd14eb2f6dbbef83b6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-08 06:41:24 +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
Yuhang Zhao
b43988ada2 Clang: use -Oz instead of -O1 to optimize for size
Change-Id: I60fecba64e968d10b87a9c1af571ff4a3aa98ad7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-21 23:46:32 +00:00
BogDan Vatra
09ea013ae1 Use libc++ instead of libstdc++ when compiling with android-clang mkspec
clang+libc++ is the only supported way by Google nowadays.
libstdc++ is too old and already fails to build some C++11 apps
e.g. missing std::to_string().

android-g++ mkspec still uses libstdc++ and g++.

Use -isystem to include system headers instead of QMAKE_INCDIR_POST (-I).

Task-number: QTBUG-60455
Change-Id: Iba8b04594c2e5e2832e6cf480e4e52ff31ad4106
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-08-23 12:47:58 +00:00
Kai Koehne
032d402485 mkspecs: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I04c403f81bb8a8d6d6222573030d1e6d09ec4c3d
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:43 +00:00
Liang Qi
bce25a6340 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/gui/painting/qcoregraphics.mm
	src/gui/painting/qcoregraphics_p.h
	src/plugins/platforms/cocoa/qcocoahelpers.h
	src/plugins/platforms/cocoa/qcocoahelpers.mm

Change-Id: Ibe5efcae73526b3d3931ed22730b13d372dcf54e
2016-11-25 14:41:29 +01:00
BogDan Vatra
17d72c7837 Android: All gcc flags should be set for clang too
gcc-base-unix.conf must be included before clang.conf because
clang.conf doesn't set all the needed flags.

Change-Id: I71f95732d0d245096b575c91610800d91c6aa5d7
Reviewed-by: Vyacheslav Koscheev <vok1980@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-25 06:06:57 +00:00
Liang Qi
4783de0473 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/network/socket/qnativesocketengine_winrt.cpp
	tools/configure/configureapp.cpp
	tools/configure/environment.cpp

Change-Id: Ieae6f2ee004a87f041751852b687484f91ee4480
2016-11-24 10:31:21 +01:00
Vyacheslav Koscheev
0a203faa7f Adjust comment to "new" spec name
Change-Id: I58250de09f10637b145a5f43c3764a86e47bce96
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-22 05:39:51 +00:00
Liang Qi
905329200f Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/gui/image/qpixmap.cpp
	src/widgets/kernel/qformlayout.cpp

Change-Id: I8a8391a202adf7f18464a22ddf0a6c4974eab692
2016-10-11 07:40:32 +02:00
BogDan Vatra
98cb497772 Add QMAKE_LFLAGS_SONAME to linker flags for Android plugins
It's needed to shut up Android 6+ warnings

Task-number: QTBUG-52112
Change-Id: I21ff53d687bf545250ec7fcdc059db16d4cecbc9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-10-06 13:33:08 +00:00
Jake Petroules
12bc984f65 Clean up QT_QPA_DEFAULT_PLATFORM handling
This is now centralized in configure.pri except where it explicitly
needs to be overridden.

Change-Id: If829d6b5eecf9a5fc403d0a0600d12c9e5781525
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-05 19:07:30 +00:00
BogDan Vatra
27a0ec9b9a Revert "Android: use gold linker"
It seems there is a configure test which should enable it.

This reverts commit 7e4f0ad961.

Change-Id: I39c594e5e779732d2f5954b42e266a1eaa1be3f0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-16 13:31:38 +00:00
BogDan Vatra
7e4f0ad961 Android: use gold linker
Change-Id: Ie09430cd02d431abc33af2ea79606f43882b7ccd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-08-15 13:31:08 +00:00
BogDan Vatra
f78044c0a4 Android: Use -gcc-toolchain for clang linker command
Change-Id: I0434d806dd9dafa12186c989e3b11964e41487fe
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-08-15 13:30:58 +00:00
BogDan Vatra
68f22d84ab Android: Add support for clang compiler
[ChangeLog][Android] Added support for clang compiler

Task-number: QTBUG-50724
Change-Id: I6147021b814fcb230d125c4450c554a7fea8f31e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-07-20 16:53:10 +00:00