Add support for arm 64
This commit is contained in:
parent
58e74a0cf0
commit
39e4ddd006
@ -1,7 +1,11 @@
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
import org.gradle.api.NamedDomainObjectContainer
|
||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
import org.gradle.nativeplatform.platform.internal.Architectures
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
|
||||
import java.lang.RuntimeException
|
||||
|
||||
/**
|
||||
* Created by Ugljesa Jovanovic
|
||||
@ -20,14 +24,35 @@ fun getHostOsName(): String {
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
fun getHostArchitecture(): String {
|
||||
val architecture =System.getProperty("os.arch")
|
||||
DefaultNativePlatform.getCurrentArchitecture()
|
||||
println("Arch: $architecture")
|
||||
val resolvedArch = Architectures.forInput(architecture).name
|
||||
println("Resolved arch: $resolvedArch")
|
||||
return resolvedArch
|
||||
}
|
||||
|
||||
fun KotlinMultiplatformExtension.isRunningInIdea(block : KotlinMultiplatformExtension.() -> Unit) {
|
||||
if (isInIdea()) {
|
||||
block(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun KotlinMultiplatformExtension.runningOnLinux(block : KotlinMultiplatformExtension.() -> Unit) {
|
||||
if (getHostOsName() == "linux") {
|
||||
fun KotlinMultiplatformExtension.runningOnLinuxx86_64(block : KotlinMultiplatformExtension.() -> Unit) {
|
||||
if (getHostOsName() == "linux" && getHostArchitecture() == "x86-64") {
|
||||
block(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun KotlinMultiplatformExtension.runningOnLinuxxArm64(block : KotlinMultiplatformExtension.() -> Unit) {
|
||||
if (getHostOsName() == "linux" && getHostArchitecture() == "arm-v8") {
|
||||
block(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun KotlinMultiplatformExtension.runningOnLinuxxArm32(block : KotlinMultiplatformExtension.() -> Unit) {
|
||||
if (getHostOsName() == "linux" && getHostArchitecture() == "arm-v7") {
|
||||
block(this)
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
|
||||
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
|
||||
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
||||
|
||||
plugins {
|
||||
kotlin(PluginsDeps.multiplatform)
|
||||
@ -48,7 +47,7 @@ fun getHostOsName(): String {
|
||||
|
||||
kotlin {
|
||||
val hostOsName = getHostOsName()
|
||||
runningOnLinux {
|
||||
runningOnLinuxx86_64 {
|
||||
jvm()
|
||||
js {
|
||||
compilations {
|
||||
@ -88,6 +87,11 @@ kotlin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
runningOnLinuxxArm64 {
|
||||
//Not supported in coroutines at the moment
|
||||
linuxArm32Hfp() {
|
||||
binaries {
|
||||
@ -102,7 +106,6 @@ kotlin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
runningOnMacos {
|
||||
|
@ -55,7 +55,7 @@ println("Idea active: $ideaActive")
|
||||
|
||||
kotlin {
|
||||
val hostOsName = getHostOsName()
|
||||
runningOnLinux {
|
||||
runningOnLinuxx86_64 {
|
||||
jvm()
|
||||
js {
|
||||
browser {
|
||||
|
10
sodiumWrapper/configure
vendored
10
sodiumWrapper/configure
vendored
@ -20,6 +20,14 @@ if [ -z "$SYSROOT" ]; then
|
||||
export CC=$(find $KONAN/dependencies -wholename *${ARCH/_/-}/bin/*$GCC | head -n1)
|
||||
;;
|
||||
|
||||
**Linux*aarch64**)
|
||||
echo "Linux ARM env"
|
||||
GCC=${GCC:-gcc}
|
||||
GCC=gcc
|
||||
export CC=$(find $KONAN/dependencies -wholename *${ARCH/_/-}/bin/*$GCC | head -n1)
|
||||
;;
|
||||
|
||||
|
||||
**Darwin*x86_64**)
|
||||
echo "Darwin env"
|
||||
GCC=${GCC:-clang}
|
||||
@ -39,4 +47,4 @@ if [ -z "$SYSROOT" ]; then
|
||||
echo $CC
|
||||
fi
|
||||
|
||||
./configure --prefix=$PREFIX "$@"
|
||||
./configure --prefix=$PREFIX "$@"
|
Loading…
x
Reference in New Issue
Block a user