Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Kotlin MacOS Arm64 native target #17

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions anoncreds/build-kotlin-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ for target in "${apple_targets[@]}"; do
cargo build --release --target $target
done

# # Merge libraries with lipo
mkdir -p $OUT_PATH/macos-native/
# Merge mac libraries with lipo
mkdir -p $OUT_PATH/macos-native/static
mkdir -p $OUT_PATH/macos-native/dynamic

# dylib for JVM
lipo -create $AARCH64_APPLE_DARWIN_PATH/lib$NAME.dylib \
$X86_64_APPLE_DARWIN_PATH/lib$NAME.dylib \
-output $OUT_PATH/macos-native/lib$NAME.dylib
-output $OUT_PATH/macos-native/dynamic/lib$NAME.dylib

# .a for Native
lipo -create $AARCH64_APPLE_DARWIN_PATH/lib$NAME.a \
$X86_64_APPLE_DARWIN_PATH/lib$NAME.a \
-output $OUT_PATH/macos-native/static/lib$NAME.a

cargo install cross --git https://github.com/cross-rs/cross

Expand Down
14 changes: 11 additions & 3 deletions askar/build-kotlin-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ for target in "${apple_targets[@]}"; do
cargo build --release --target $target
done

# # Merge libraries with lipo
mkdir -p $OUT_PATH/macos-native/
# Merge mac libraries with lipo
mkdir -p $OUT_PATH/macos-native/static
mkdir -p $OUT_PATH/macos-native/dynamic

# dylib for JVM
lipo -create $AARCH64_APPLE_DARWIN_PATH/lib$NAME.dylib \
$X86_64_APPLE_DARWIN_PATH/lib$NAME.dylib \
-output $OUT_PATH/macos-native/lib$NAME.dylib
-output $OUT_PATH/macos-native/dynamic/lib$NAME.dylib

# .a for Native
lipo -create $AARCH64_APPLE_DARWIN_PATH/lib$NAME.a \
$X86_64_APPLE_DARWIN_PATH/lib$NAME.a \
-output $OUT_PATH/macos-native/static/lib$NAME.a

cargo install cross --git https://github.com/cross-rs/cross

Expand Down
14 changes: 11 additions & 3 deletions indy-vdr/build-kotlin-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,19 @@ for target in "${apple_targets[@]}"; do
cargo build --release --target $target
done

# Merge libraries with lipo
mkdir -p $OUT_PATH/macos-native/
# Merge mac libraries with lipo
mkdir -p $OUT_PATH/macos-native/static
mkdir -p $OUT_PATH/macos-native/dynamic

# dylib for JVM
lipo -create $AARCH64_APPLE_DARWIN_PATH/lib$NAME.dylib \
$X86_64_APPLE_DARWIN_PATH/lib$NAME.dylib \
-output $OUT_PATH/macos-native/lib$NAME.dylib
-output $OUT_PATH/macos-native/dynamic/lib$NAME.dylib

# .a for Native
lipo -create $AARCH64_APPLE_DARWIN_PATH/lib$NAME.a \
$X86_64_APPLE_DARWIN_PATH/lib$NAME.a \
-output $OUT_PATH/macos-native/static/lib$NAME.a

cargo install cross --git https://github.com/cross-rs/cross

Expand Down
6 changes: 3 additions & 3 deletions kotlin/anoncreds/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ val processBinaries = tasks.register("processBinaries", Copy::class) {
.resolve("jvm")
.resolve("main")

from(uniffiBindings.resolve("macos-native"))
from(uniffiBindings.resolve("macos-native").resolve("dynamic"))
include("*.dylib")
into(directory)
}
Expand Down Expand Up @@ -158,12 +158,12 @@ kotlin {
}

macosX64{
val libDirectory = "${anoncredsDir}/target/x86_64-apple-darwin/release"
val libDirectory = "${uniffiBindings}/macos-native/static"
addLibs(libDirectory, this)
}

macosArm64{
val libDirectory = "${anoncredsDir}/target/aarch64-apple-darwin/release"
val libDirectory = "${uniffiBindings}/macos-native/static"
addLibs(libDirectory, this)
}

Expand Down
3 changes: 1 addition & 2 deletions kotlin/anoncreds/src/nativeInterop/cinterop/uniffi.def
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ libraryPaths.ios_arm64 = ../../anoncreds/target/aarch64-apple-ios/release
libraryPaths.ios_simulator_arm64 = ../../anoncreds/target/aarch64-apple-ios-sim/release

staticLibraries.osx = libanoncreds_uniffi.a
libraryPaths.macos_x64 = ../../anoncreds/target/x86_64-apple-darwin/release ../../anoncreds/target/aarch64-apple-darwin/release
libraryPaths.macos_arm64 = ../../anoncreds/target/aarch64-apple-darwin/release ../../anoncreds/target/x86_64-apple-darwin/release
libraryPaths.osx = ../../anoncreds/out/kmpp-uniffi/macos-native/static
6 changes: 3 additions & 3 deletions kotlin/askar/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ val processBinaries = tasks.register("processBinaries", Copy::class) {
.resolve("jvm")
.resolve("main")

from(uniffiBindings.resolve("macos-native"))
from(uniffiBindings.resolve("macos-native").resolve("dynamic"))
include("*.dylib")
into(directory)
}
Expand Down Expand Up @@ -157,12 +157,12 @@ kotlin {
}

macosX64{
val libDirectory = "${askarDir}/target/x86_64-apple-darwin/release"
val libDirectory = "${uniffiBindings}/macos-native/static"
addLibs(libDirectory, this)
}

macosArm64{
val libDirectory = "${askarDir}/target/aarch64-apple-darwin/release"
val libDirectory = "${uniffiBindings}/macos-native/static"
addLibs(libDirectory, this)
}

Expand Down
3 changes: 1 addition & 2 deletions kotlin/askar/src/nativeInterop/cinterop/uniffi.def
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ libraryPaths.ios_arm64 = ../../askar/target/aarch64-apple-ios/release
libraryPaths.ios_simulator_arm64 = ../../askar/target/aarch64-apple-ios-sim/release

staticLibraries.osx = libaskar_uniffi.a
libraryPaths.macos_x64 = ../../askar/target/x86_64-apple-darwin/release ../../askar/target/aarch64-apple-darwin/release
libraryPaths.macos_arm64 = ../../askar/target/aarch64-apple-darwin/release ../../askar/target/x86_64-apple-darwin/release
libraryPaths.osx = ../../askar/out/kmpp-uniffi/macos-native/static
6 changes: 3 additions & 3 deletions kotlin/indy-vdr/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ val processBinaries = tasks.register("processBinaries", Copy::class) {
.resolve("jvm")
.resolve("main")

from(uniffiBindings.resolve("macos-native"))
from(uniffiBindings.resolve("macos-native").resolve("dynamic"))
include("*.dylib")
into(directory)
}
Expand Down Expand Up @@ -157,12 +157,12 @@ kotlin {
}

macosX64{
val libDirectory = "${vdrDir}/target/x86_64-apple-darwin/release"
val libDirectory = "${uniffiBindings}/macos-native/static"
addLibs(libDirectory, this)
}

macosArm64{
val libDirectory = "${vdrDir}/target/aarch64-apple-darwin/release"
val libDirectory = "${uniffiBindings}/macos-native/static"
addLibs(libDirectory, this)
}

Expand Down
3 changes: 1 addition & 2 deletions kotlin/indy-vdr/src/nativeInterop/cinterop/uniffi.def
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ libraryPaths.ios_arm64 = ../../indy-vdr/target/aarch64-apple-ios/release
libraryPaths.ios_simulator_arm64 = ../../indy-vdr/target/aarch64-apple-ios-sim/release

staticLibraries.osx = libindy_vdr_uniffi.a
libraryPaths.macos_x64 = ../../indy-vdr/target/x86_64-apple-darwin/release ../../indy-vdr/target/aarch64-apple-darwin/release
libraryPaths.macos_arm64 = ../../indy-vdr/target/aarch64-apple-darwin/release ../../indy-vdr/target/x86_64-apple-darwin/release
libraryPaths.osx = ../../indy-vdr/out/kmpp-uniffi/macos-native/static