mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2025-03-25 17:43:58 +03:00
fix build error and filter target arch (#443)
This commit is contained in:
parent
57f043408f
commit
a012d81cd1
@ -52,6 +52,10 @@ subprojects {
|
||||
resValue("string", "release_name", "v$versionName")
|
||||
resValue("integer", "release_code", "$versionCode")
|
||||
|
||||
ndk {
|
||||
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
abiFilters("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||
@ -164,6 +168,8 @@ subprojects {
|
||||
abi {
|
||||
isEnable = true
|
||||
isUniversalApk = true
|
||||
reset()
|
||||
include("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -189,4 +195,4 @@ tasks.wrapper {
|
||||
file("gradle/wrapper/gradle-wrapper.properties")
|
||||
.appendText("distributionSha256Sum=$sha256")
|
||||
}
|
||||
}
|
||||
}
|
@ -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 ->
|
||||
afterEvaluate {
|
||||
for ((abi, goAbi) in abis) {
|
||||
val cmakeName = if (variant.buildType == "debug") "Debug" else "RelWithDebInfo"
|
||||
tasks.getByName("buildCMake$cmakeName[$abi]").dependsOn(tasks.getByName("externalGolangBuild${variant.name.capitalizeUS()}$goAbi"))
|
||||
val cmakeName = if (variant.buildType == "debug") "Debug" else "RelWithDebInfo"
|
||||
|
||||
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…
x
Reference in New Issue
Block a user