Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qtbase] enable ci for android #35845

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[qtbase] enable egl for android
m-kuhn committed Jul 26, 2024
commit c76efc8792540836c150e662a85851eeb20982b7
8 changes: 6 additions & 2 deletions ports/qtbase/cmake/qt_install_submodule.cmake
Original file line number Diff line number Diff line change
@@ -8,8 +8,12 @@ if(NOT DEFINED QT6_DIRECTORY_PREFIX)
set(QT6_DIRECTORY_PREFIX "Qt6/")
endif()

if(VCPKG_TARGET_IS_ANDROID AND NOT ANDROID_SDK_ROOT)
message(FATAL_ERROR "${PORT} requires ANDROID_SDK_ROOT to be set. Consider adding it to the triplet." )
if(VCPKG_TARGET_IS_ANDROID)
if(NOT ANDROID_SDK_ROOT)
message(FATAL_ERROR "${PORT} requires ANDROID_SDK_ROOT to be set. Set ANDROID_SDK_ROOT as environment variable or in the triplet.")
elseif(NOT IS_DIRECTORY ${ANDROID_SDK_ROOT})
message(FATAL_ERROR "ANDROID_SDK_ROOT is set to `${ANDROID_SDK_ROOT}` which is not a directory.")
endif()
endif()

function(qt_download_submodule_impl)
3 changes: 2 additions & 1 deletion ports/qtbase/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "qtbase",
"version": "6.7.2",
"port-version": 1,
"description": "Qt Base (Core, Gui, Widgets, Network, ...)",
"homepage": "https://www.qt.io/",
"license": null,
@@ -193,7 +194,7 @@
},
"egl": {
"description": "EGL",
"supports": "linux",
"supports": "linux | android",
"dependencies": [
"egl"
]
13 changes: 13 additions & 0 deletions scripts/azure-pipelines/android/Dockerfile
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# DisableDockerDetector "Used to build the container deployed to Azure Container Registry"
FROM ubuntu:focal-20240530

ADD https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip /android-sdk-11076708.zip
ADD https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb /packages-microsoft-prod.deb
ADD https://dl.google.com/android/repository/android-ndk-r26d-linux.zip /android-ndk-r26d-linux.zip

@@ -62,8 +63,20 @@ apt-get -y --no-install-recommends install $APT_PACKAGES
# Android NDK
unzip /android-ndk-r26d-linux.zip
rm -f android-ndk-r26d-linux.zip

# Android SDK
unzip /android-sdk-11076708.zip -d android-sdk
rm -f android-sdk-11076708.zip

shopt -s extglob
mkdir /android-sdk/cmdline-tools/latest
# https://stackoverflow.com/questions/65262340/cmdline-tools-could-not-determine-sdk-root
mv /android-sdk/cmdline-tools/!(latest) /android-sdk/cmdline-tools/latest
yes | /android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses
/android-sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "build-tools;29.0.2" "platform-tools" "tools"
END_OF_SCRIPT

ENV ANDROID_NDK_HOME /android-ndk-r26d
ENV ANDROID_SDK_ROOT /android-sdk

WORKDIR /vcpkg
1 change: 1 addition & 0 deletions triplets/arm-neon-android.cmake
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Android)
set(VCPKG_MAKE_BUILD_TRIPLET "--host=armv7a-linux-androideabi")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=armeabi-v7a -DANDROID_ARM_NEON=ON)
set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't help with ABI hashes: The content of the triplet files remains independent of the content of ENV{ANDROID_SDK_ROOT}.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only way I know to bring this into ABI hashes is by (a) writing it into an overlay triplet, but as you mentioned, this is intrusive on user side.
Or we respect environment variables, either by inspecting them (b) in the triplet (done currently) or (c) in the android toolchain (done before) or (d) in the port and forward it to cmake configure from there.

And if I understand correctly, your preference is (d)?

1 change: 1 addition & 0 deletions triplets/arm64-android.cmake
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Android)
set(VCPKG_MAKE_BUILD_TRIPLET "--host=aarch64-linux-android")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=arm64-v8a)
set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT})
1 change: 1 addition & 0 deletions triplets/x64-android.cmake
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Android)
set(VCPKG_MAKE_BUILD_TRIPLET "--host=x86_64-linux-android")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=x86_64)
set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT})