[Fix] (ci): cache native compilation

This commit is contained in:
2026-06-22 09:24:21 +08:00
parent dac5f8964f
commit b87b698148
4 changed files with 91 additions and 2 deletions
+12
View File
@@ -18,6 +18,9 @@ def releaseSigningReady = signingStoreFile.exists()
&& signingKeyAlias
&& signingKeyPassword
def debuggableRelease = (findProperty('mobilegl.debuggableRelease') ?: 'false').toString().toBoolean()
def mobileGlCmakeCompilerLauncher = {
(findProperty('mobilegl.cmakeCompilerLauncher') ?: System.getenv('MOBILEGL_CMAKE_COMPILER_LAUNCHER') ?: '').toString().trim()
}
def mobileGlAbiFilters = {
def abiList = (findProperty('mobilegl.abis') ?: System.getenv('MOBILEGL_ABIS') ?: 'arm64-v8a') as String
if (abiList.equalsIgnoreCase('all')) {
@@ -46,6 +49,15 @@ android {
abiFilters(*abiFiltersOverride)
}
}
externalNativeBuild {
cmake {
def compilerLauncher = mobileGlCmakeCompilerLauncher()
if (!compilerLauncher.isEmpty()) {
arguments "-DCMAKE_C_COMPILER_LAUNCHER=${compilerLauncher}",
"-DCMAKE_CXX_COMPILER_LAUNCHER=${compilerLauncher}"
}
}
}
}
flavorDimensions 'backend', 'profile'
+9
View File
@@ -18,6 +18,10 @@ def mobileGlLogActiveLevel = {
(rootProject.findProperty('mobilegl.logLevel') ?: System.getenv('MOBILEGL_LOG_ACTIVE_LEVEL') ?: 'MOBILEGL_LOG_LEVEL_INFO') as String
}
def mobileGlCmakeCompilerLauncher = {
(rootProject.findProperty('mobilegl.cmakeCompilerLauncher') ?: System.getenv('MOBILEGL_CMAKE_COMPILER_LAUNCHER') ?: '').toString().trim()
}
subprojects { subproject ->
subproject.plugins.withId('com.android.library') {
subproject.android {
@@ -30,6 +34,11 @@ subprojects { subproject ->
}
externalNativeBuild {
cmake {
def compilerLauncher = mobileGlCmakeCompilerLauncher()
if (!compilerLauncher.isEmpty()) {
arguments "-DCMAKE_C_COMPILER_LAUNCHER=${compilerLauncher}",
"-DCMAKE_CXX_COMPILER_LAUNCHER=${compilerLauncher}"
}
cppFlags "-DMOBILEGL_LOG_ACTIVE_LEVEL=${mobileGlLogActiveLevel()}"
}
}