Add multiBackend Android flavor for runtime OpenGL/Vulkan switching (#4288)

This commit is contained in:
Veniamin Vynohradov
2026-08-06 16:54:58 +03:00
committed by GitHub
parent ccb9af119e
commit b0388d186d
47 changed files with 896 additions and 163 deletions

View File

@@ -2,8 +2,18 @@ cmake_minimum_required(VERSION 3.10)
project(MapLibreAndroid)
add_subdirectory(../../../../../
../../../../../${ANDROID_ABI})
# (a) Multi-flavor build is self-contained in MultiBackend.cmake and only entered for the
# Gradle `multiBackend` flavor (which passes -DMLN_ANDROID_MULTI_BACKEND=ON). It never touches
# the shared top-level CMakeLists; the single-backend path below is unaffected.
if(MLN_ANDROID_MULTI_BACKEND)
include(${CMAKE_CURRENT_SOURCE_DIR}/MultiBackend.cmake)
return()
endif()
# (b) Build core into THIS configure's own build dir (was: ../../../../../${ANDROID_ABI}, an
# out-of-tree path both multi sub-builds collided on). Each configure now has its own dir, so
# the multi sub-builds isolate automatically -- no MLN_ANDROID_TOP_BINARY_DIR guard needed.
add_subdirectory(../../../../../ ${CMAKE_CURRENT_BINARY_DIR}/maplibre-core)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)