Skip to content

Commit

Permalink
Added build targets iosArm64, androidNativeX64
Browse files Browse the repository at this point in the history
  • Loading branch information
smyrgeorge committed Aug 19, 2024
1 parent c95fa36 commit e2d50d9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = "io.github.smyrgeorge"
version = "0.4.1"
version = "0.4.2"

plugins {
// https://plugins.gradle.org/plugin/org.jetbrains.kotlin.multiplatform
Expand Down
6 changes: 4 additions & 2 deletions sqlx4k/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private val cargo: String
?: throw GradleException("Rust cargo binary is required to build project but it wasn't found.")

val chosenTargets = (properties["targets"] as? String)?.split(",")
?: listOf("macosArm64", "macosX64", "linuxArm64", "linuxX64")
?: listOf("iosArm64", "androidNativeX64", "macosArm64", "macosX64", "linuxArm64", "linuxX64")

kotlin {
fun KotlinNativeTarget.rust(target: String) {
Expand Down Expand Up @@ -68,9 +68,11 @@ kotlin {
}

val availableTargets = mapOf(
Pair("iosArm64") { iosArm64 { rust("aarch64-apple-ios") } },
Pair("androidNativeX64") { androidNativeX64 { rust("aarch64-linux-android") } },
Pair("macosArm64") { macosArm64 { rust("aarch64-apple-darwin") } },
Pair("macosX64") { macosX64 { rust("x86_64-apple-darwin") } },
Pair("linuxArm64") { linuxArm64 { rust("aarch64-unknown-linux-gnu") } },
Pair("macosX64") { macosX64 { rust("x86_64-apple-darwin") } },
Pair("linuxX64") { linuxX64 { rust("x86_64-unknown-linux-gnu") } },
)
chosenTargets.forEach {
Expand Down
6 changes: 6 additions & 0 deletions sqlx4k/src/nativeInterop/cinterop/aarch64-apple-ios.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package = librust_lib
headers = rust_lib.h
compilerOpts = -I./rust_lib/target

staticLibraries = librust_lib.a
libraryPaths = ./rust_lib/target/aarch64-apple-ios/release
6 changes: 6 additions & 0 deletions sqlx4k/src/nativeInterop/cinterop/aarch64-linux-android.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package = librust_lib
headers = rust_lib.h
compilerOpts = -I./rust_lib/target

staticLibraries = librust_lib.a
libraryPaths = ./rust_lib/target/aarch64-linux-android/release

0 comments on commit e2d50d9

Please sign in to comment.