Android: Integrate vcpkg with Gradle build

This ensures that vcpkg downloads and builds all dependencies for
Android. We add it as a CMAKE_TOOLCHAIN_FILE that then chainloads the
Android NDK's toolchain file, as per the vcpkg documentation.
This commit is contained in:
Alex Studer
2024-07-03 15:17:16 -04:00
committed by Andrew Kaster
parent ab82fc8993
commit 1d0de0b450
Notes: sideshowbarker 2024-07-16 22:54:10 +09:00
5 changed files with 132 additions and 7 deletions

View File

@@ -1,5 +1,12 @@
cmake_minimum_required(VERSION 3.25)
if (VCPKG_TARGET_ANDROID)
# If we are building for Android, we must load vcpkg_android.cmake before the project() declaration.
# This ensures that the CMAKE_TOOLCHAIN_FILE is set correctly.
# (we cannot set CMAKE_TOOLCHAIN_FILE from Gradle, unfortunately, so this is the only place we can do it.)
include("Ladybird/Android/vcpkg_android.cmake")
endif()
project(ladybird
VERSION 0.1.0
LANGUAGES C CXX