mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2025-03-29 11:49:55 +03:00
fix build error and filter target arch (#443)
This commit is contained in:
parent
57f043408f
commit
a012d81cd1
2 changed files with 17 additions and 7 deletions
|
@ -52,6 +52,10 @@ subprojects {
|
||||||
resValue("string", "release_name", "v$versionName")
|
resValue("string", "release_name", "v$versionName")
|
||||||
resValue("integer", "release_code", "$versionCode")
|
resValue("integer", "release_code", "$versionCode")
|
||||||
|
|
||||||
|
ndk {
|
||||||
|
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||||
|
}
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
abiFilters("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
abiFilters("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||||
|
@ -164,6 +168,8 @@ subprojects {
|
||||||
abi {
|
abi {
|
||||||
isEnable = true
|
isEnable = true
|
||||||
isUniversalApk = true
|
isUniversalApk = true
|
||||||
|
reset()
|
||||||
|
include("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,13 +62,17 @@ afterEvaluate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val abis = listOf("armeabi-v7a" to "ArmeabiV7a", "arm64-v8a" to "Arm64V8a", "x86_64" to "X8664", "x86" to "X86")
|
val abis = listOf("arm64-v8a" to "Arm64V8a", "armeabi-v7a" to "ArmeabiV7a", "x86" to "X86", "x86_64" to "X8664")
|
||||||
|
|
||||||
androidComponents.onVariants { variant ->
|
androidComponents.onVariants { variant ->
|
||||||
afterEvaluate {
|
|
||||||
for ((abi, goAbi) in abis) {
|
|
||||||
val cmakeName = if (variant.buildType == "debug") "Debug" else "RelWithDebInfo"
|
val cmakeName = if (variant.buildType == "debug") "Debug" else "RelWithDebInfo"
|
||||||
tasks.getByName("buildCMake$cmakeName[$abi]").dependsOn(tasks.getByName("externalGolangBuild${variant.name.capitalizeUS()}$goAbi"))
|
|
||||||
|
abis.forEach { (abi, goAbi) ->
|
||||||
|
tasks.configureEach {
|
||||||
|
if (name.startsWith("buildCMake$cmakeName[$abi]")) {
|
||||||
|
dependsOn("externalGolangBuild${variant.name.capitalizeUS()}$goAbi")
|
||||||
|
println("Set up dependency: $name -> externalGolangBuild${variant.name.capitalizeUS()}$goAbi")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue