From 89d5a4f9115eb730d641582e8317d6e00a785f39 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 20 Oct 2023 22:29:59 +0600 Subject: [PATCH] add support of arch target --- ResenderBot/native_launcher/build.gradle | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ResenderBot/native_launcher/build.gradle b/ResenderBot/native_launcher/build.gradle index fa67557..b5314cd 100644 --- a/ResenderBot/native_launcher/build.gradle +++ b/ResenderBot/native_launcher/build.gradle @@ -16,10 +16,21 @@ plugins { kotlin { def hostOs = System.getProperty("os.name") def isMingwX64 = hostOs.startsWith("Windows") + def isArch64 = System.getProperty("os.arch") == "aarch64" def nativeTarget - if (hostOs == "Linux") nativeTarget = linuxX64("native") { binaries { executable() } } - else if (isMingwX64) nativeTarget = mingwX64("native") { binaries { executable() } } - else throw new GradleException("Host OS is not supported in Kotlin/Native.") + if (hostOs == "Linux") { + if (isArch64) { + nativeTarget = linuxArm64("native") { binaries { executable() } } + } else { + nativeTarget = linuxX64("native") { binaries { executable() } } + } + } else { + if (isMingwX64) { + nativeTarget = mingwX64("native") { binaries { executable() } } + } else { + throw new GradleException("Host OS is not supported in Kotlin/Native.") + } + } sourceSets { commonMain {