aboutsummaryrefslogtreecommitdiff
path: root/toolchain/Android.cmake
AgeCommit message (Collapse)Author
2022-03-08Android: Set CMAKE_TRY_COMPILE_PLATFORM_VARIABLESAlbert Astals Cid
These are the variables that cmake will pass onto itself when doing a try_compile, we need that because otherwise when trying to find iconv it will issue a try compile, won't pass CMAKE_ANDROID_API so it will default to 21 (instead eg the 28 we had given it) and the try_compile will fail because android libc only has iconv after API 28
2022-02-11Adapt Android toolchain file and FindGradle to Qt6Volker Krause
- We don't need the Threads target workaround anymore, that breaks the build with Qt6 even. - The Gradle wrapper shipped with Qt is no longer installed as executable, so we need to run this in sh explicitly. - Qt6 uses a different Android Gradle plugin version (not to be confused with the Gradle version), which we need to make available for the configure_file() call on the build.gradle file. With this most Framework modules build against Qt6 here.
2021-10-13[android] Extend NDK workaround to version 22Nicolas Fella
The relevant issue is only fixed in 23
2021-09-13Make sphinx happier about syntaxAlbert Astals Cid
And the generated html looks more correct
2021-04-23Modules docs: move rst docs into bracket commentsFriedrich W. H. Kossebau
CMake >= 3.0 supports bracket comments, and the reStructuredText integration code in sphinx/ext/ecm.py already supports extracting the docs from a bracket comment instead. Editing documentation without leading line comment markers is more simple, e,g. when reflowing text over lines. With ECM meanwhile requiring CMake 3.5 now it is possible to switch (and thus follow also the approach used by cmake itself). NO_CHANGELOG
2021-04-07Document the advanced APK packaging optionsVolker Krause
2020-12-20bump required cmake version for Android.cmakeJohnny Jazeix
BUG: 424392
2020-09-20Fix configuring with pthread on Android 32 bitGabriel Souza Franco
2020-09-16Fix find_library on Android with NDK < 22Gabriel Souza Franco
2020-09-16Explicitly sort Android version listsGabriel Souza Franco
Also document --android-platform parameter
2020-09-16Store Android {min,target,compile}Sdk in variablesGabriel Souza Franco
Also pass along these values to androiddeployqt
2020-06-22Deal with Qt's CMake code modifying CMAKE_SHARED_LIBRARY_SUFFIXVolker Krause
Qt adds the Android ABI to the suffix there unconditionally, without also adjusting CMAKE_FIND_LIBRARY_SUFFIXES accordingly, breaking find_library() for things built that way. Unfortunately we can't just set this in our toolchain file, as CMAKE_FIND_LIBRARY_SUFFIXES is overwritten by CMake after evaluating the toolchain file. So we need to use the variable_watch hack for this here, thanks to Aleix for the idea. With this, find_library() works for both suffixed and un-suffixed libraries again, such as Poppler built with or without Qt support.
2020-06-14extra-cmake-modules: Convert to SPDX license statementsAndreas Cord-Landwehr
2020-05-19[android] Use newer Qt version in examplev5.71.0-rc3v5.71.0-rc2v5.71.0-rc1v5.71.0Nicolas Fella
2020-05-11[android] Allow specifying APK install locationNicolas Fella
Summary: This allows `make create-apk` to directly write the APK to /output instead of the cp-with-prefix step in /opt/helpers/create-apk. It's also useful for manual development builds where one would need to copy it to some output location manually or for CI setups that expect the output in a certain location. If ANDROID_APK_INSTALL_DIR is not set the current behaviour is kept. Reviewers: #frameworks, #android, apol, vkrause Reviewed By: #android, apol Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D29631
2020-03-03Support NDK r20 and Qt 5.14Volker Krause
Summary: This changes from using the toolchain file provided by CMake to using the one provided by the NDK, as even recent CMake can't build successfully with r20. However this is a rather invasive change, the interface and variable names differ. The Qt 5.14 changes are less risky, as most of this is parallel to the support for older versions. Test Plan: Local builds with 5.14/r20, 5.14/r18 work, the Docker SDK isn't tested yet, and there's some remaining issues with 5.13 and older NDKs I don't fully understand yet. The resulting apks with 5.14 install, and work for QQC2 content, but fail to start Kirigami apps. Reviewers: apol Reviewed By: apol Subscribers: flherne, apol, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Maniphest Tasks: T12520 Differential Revision: https://phabricator.kde.org/D26749
2019-07-29android: Allow overriding ANDROID_ARCH and ANDROID_ARCH_ABI as envvarsv5.61.0-rc1v5.61.0Aleix Pol
2019-07-08Fix type names casingAleix Pol
Summary: It's supposed to be uppercase, cmake was warning about it. Test Plan: Now it builds as well, but cmake doesn't complain. Reviewers: #frameworks, #android, vkrause Reviewed By: #android, vkrause Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D22317
2019-02-26Android: Reflect on using clang nowv5.56.0-rc1v5.56.0Aleix Pol
2019-02-15Update Android toolchain files to realityVolker Krause
Summary: - NDK r18 does not ship GCC anymore, it's only clang now - same for STL, there's only libc++ there - API level 14 is not supported either anymore, the minimum supported by the current NDK is 16 - The minimum supported API level by KF5 right now is 21 though, so use that as the default Reviewers: apol Reviewed By: apol Subscribers: apol, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D19016
2019-01-09Use more https in linksFriedrich W. H. Kossebau
2018-11-19Android: improve clang supportAleix Pol
Summary: Infer the toolchain we are using through cmake's detection of ranlib instead of asking the user to fill it. It's only used in androiddeployqt and cmake expects it to be version "clang" for clang builds while androiddeployqt expects it to be "4.9". Reviewers: #build_system, #android, vkrause Reviewed By: #android, vkrause Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D16930
2018-09-29Android: Allow passing a relative path as the apk dirAleix Pol
Summary: This way the project can generate automatically its own manifest file. GCompris is using it to set the version. Test Plan: Built GCompris without a warning saying the apkdir isn't found Reviewers: #frameworks, #gcompris, jjazeix Reviewed By: #gcompris, jjazeix Subscribers: jjazeix, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D15643
2018-09-27Android: Properly offer a fallback to applications that don't have a manifestAleix Pol
The variable name was wrong, not much to see here.
2018-08-26Change documentation to reflect the real toolchain CMake nameBenjamin Port
Reviewers: apol, alexeymin Reviewed By: alexeymin Subscribers: alexeymin, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D15084
2018-08-02Android: Don't hardcode a random version of the Android SDKAleix Pol
Summary: Just default to whichever is installed Test Plan: Built kalgebra Reviewers: #frameworks, vkrause Reviewed By: vkrause Subscribers: alexeymin, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D14544
2018-07-18Fix variable definition checkAleix Pol
Summary: We'd check if the variable's value is defined, which is wrong and prevented us from properly initialising using these deprecated variables. It would also ignore the value we're passing to the actually right variable when using it. Test Plan: Built kstars which needs -DCMAKE_ANDROID_API=24 Reviewers: #frameworks, vkrause Reviewed By: vkrause Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D14187
2018-07-04Android: Make it possible to override a target's APK directoryv5.48.0-rc1v5.48.0Aleix Pol
Summary: Some projects such as marble do some operations with the APK directory before building. This allows us the project to copy the apk directory over to the build directory and do whatever it pleases. Test Plan: Built Marble Reviewers: #frameworks, vkrause Reviewed By: vkrause Subscribers: vkrause, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D13403
2018-05-31Android toolchain: allow to specify extra libs manuallyv5.47.0-rc1v5.47.0Alexey Minnekhanov
Summary: Add new variable ANDROID_EXTRA_LIBS, which can contain list of full paths to libs to include in resulting APK file. This can be used to include plugins that are not directly liked to executable, for example OpenSSL libs for QtNetwork SSL/HTTPS support. Test Plan: Build project with -DANDROID_EXTRA_LIBS="/path/to/lib.so;/path/to/other_lib.so". Build without it. In both cases verify APK contents. Reviewers: apol Reviewed By: apol Subscribers: kde-buildsystem, kde-frameworks-devel Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D13198
2018-04-17Android: fix dumb mistakesAleix Pol
Use the variable we just created to look up Qt5. Remove debug warning.
2018-04-13Make it possible to build several apk out of a projectAleix Pol
Summary: Refactor the apk-generating code into a separate function, in views of eventually even make it a module. It also changes so that if no APK dir is specified, a generic dummy one is used. Useful for proofs of concept. Test Plan: Built kate, got kate and kwrite apks Reviewers: #frameworks, #build_system, vkrause Reviewed By: vkrause Subscribers: vkrause Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D12150
2018-04-12Check if the application androiddeployqt package has a main() symbolAleix Pol
Summary: Back in the KDE Edu sprint, we decided we need such a check, otherwise you get rather frustrated when the application isn't started. A patch to androiddeployqt was submitted but rejected by the maintainer. https://codereview.qt-project.org/#/c/207941/ Test Plan: kate doesn't build if we don't pass Q_DECL_EXPORT, builds if we do. Reviewers: #frameworks, #build_system, vkrause Reviewed By: vkrause Subscribers: vkrause, vatra, aacid Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D12120
2018-04-11Android: Explicitly point at upstream documentation and deprecate duplicated ↵Aleix Pol
concepts Summary: Mark as deprecated the redundant variables and focus on the difference. Reviewers: #build_system, #frameworks, vkrause Reviewed By: vkrause Subscribers: vkrause Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D11984
2018-04-04Make use of upstream CMake infrastructure to detect the compiler toolchainv5.45.0-rc1v5.45.0Aleix Pol
Summary: Instead of having ad-hoc code for gcc, let CMake do its thing. It has a lot of logic that we may be interested in, for example it will make the clang switch much smoother. Note it raises the minimum cmake to 3.7 for Android, which was released almost 2 years ago. Test Plan: Built kalgebra on it using kdeorg/android-sdk Reviewers: #frameworks, #build_system, vkrause Reviewed By: vkrause Subscribers: vkrause Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D11776
2018-03-17Provide androiddeployqt with all prefix pathsVolker Krause
Summary: This is needed for a new feature in Qt 5.12, making androiddepolyqt's recursive dependency resolution avaiable for components installed in different prefixes too. This will allow us to drop our own partial ELF dependency parsing code eventually, as well as avoid having to do workarounds like linking against all indirect dependencies. Reviewers: #build_system, apol Reviewed By: apol Subscribers: #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D11388
2018-03-10Resolve symlinks in QML import pathsVolker Krause
Summary: qmlimportscanner fails when provided symlinks, so work around that. Reviewers: #build_system, apol Reviewed By: apol Subscribers: #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D11181
2018-03-09Provide QML import paths to androiddeployqtVolker Krause
Summary: This makes the qmlimportscanner find our QML files and plugins correctly. That's IMHO much cleaner than the full copy of everything in the lib/qml folder we do via the android-extra-plugins list. Reviewers: #build_system, apol Reviewed By: apol Subscribers: #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D11177
2018-02-24Define __ANDROID_API__Volker Krause
Summary: This is needed for NDK headers to work correctly, and is the same as the CMake code in the NDK does. Reviewers: #build_system, apol Reviewed By: apol Subscribers: apol, #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D10777
2018-02-18Remove obsolete policy settingsVolker Krause
Summary: Those affect policy propagation and search path order for relative includes in CMake code, none of which is needed here. This silences a ton of warnings with CMake 3.10. Reviewers: #build_system, apol Reviewed By: apol Subscribers: #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D10602
2018-02-18Extend search path for NDK dependenciesVolker Krause
Summary: This allows e.g. KArchive to find zlib correctly. Reviewers: #build_system, apol Reviewed By: apol Subscribers: #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D10601
2018-02-17Set ANDROID in the Android toolchain fileVolker Krause
Summary: This allows easy platforms checks in CMake files, and is the same the CMake files shipped by the Android SDK use. Reviewers: #build_system, apol Reviewed By: apol Subscribers: #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D10600
2018-02-17Fix include path for x86 targetsVolker Krause
Summary: ANDROID_TOOLCHAIN is "x86" there, while the include path we want is "i686-linux-android". ANDROID_COMPILER_PREFIX has that value in all cases (for ARM both are the same, so nothing changes there). Reviewers: #build_system, apol Reviewed By: apol Subscribers: apol, dfaure, #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D10599
2018-02-12Android toolchain: add ANDROID_COMPILER_PREFIX variable.David Faure
Summary: For ARM it's not necessary, but when building for a x86 tablet I had to set ANDROID_TOOLCHAIN=x86 while gcc/g++ are prefixed with i686-linux-android. i.e. the path is android-ndk-r10e/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-g++ Test Plan: cmake picks up the right compiler for me now Reviewers: apol, mart Reviewed By: apol Subscribers: #build_system, #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D10462
2018-01-16Android: Add more includesAlbert Astals Cid
Summary: Without this i get In file included from /home/tsdgeos/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_algo.h:59:0, from /home/tsdgeos/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/algorithm:62, from /home/tsdgeos/devel/binaryQt/5.9.2/android_armv7/include/QtCore/qglobal.h:109, from /home/tsdgeos/devel/binaryQt/5.9.2/android_armv7/include/QtGui/qtguiglobal.h:43, from /home/tsdgeos/devel/binaryQt/5.9.2/android_armv7/include/QtWidgets/qtwidgetsglobal.h:43, from /home/tsdgeos/devel/binaryQt/5.9.2/android_armv7/include/QtWidgets/qapplication.h:43, from /home/tsdgeos/devel/binaryQt/5.9.2/android_armv7/include/QtWidgets/QApplication:1, from /home/tsdgeos/devel/kde/ktuberling/main_mobile.cpp:11: /home/tsdgeos/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cstdlib:72:20: fatal error: stdlib.h: No such file or directory #include <stdlib.h> ^ compilation terminated. Reviewers: apol Reviewed By: apol Subscribers: apol, vkrause, #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D9899
2017-12-20Use readelf to find project dependenciesv5.42.0-rc1v5.42.0Aleix Pol
Summary: We were using a link.txt file that cmake used to generate, on newer cmake versions it doesn't anymore. Instead use readelf, much like androiddeployqt does, to extract the depenencies. Catch: It relies on having all the binaries being at the same subdirectory, which is the default in ECM since not long ago. Test Plan: Build kirigamigallery with it Reviewers: #frameworks, #build_system, aacid Reviewed By: aacid Subscribers: mart Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D8173
2017-11-13Only pass the ARGS thing when doing MakefilesAleix Pol
Ninja chokes on the $
2017-08-02Add --gradle to androiddeployqtv5.37.0-rc1v5.37.0Albert Astals Cid
Otherwise when trying to build with the newest Qt/android toolchains it fails Differential Revision: https://phabricator.kde.org/D6875
2017-08-02Fix install apk targetAlbert Astals Cid
Differential Revision: https://phabricator.kde.org/D6876
2017-07-13Properly point at ECMAleix Pol
Fix typo
2017-03-17Improve error messagesAleix Pol