From 5c9e7fa7f5cc233223fa7c8338a37b422118d143 Mon Sep 17 00:00:00 2001 From: Andrea Spacca Date: Sun, 24 Sep 2023 13:22:59 +0900 Subject: [PATCH 1/2] add macos support --- reqwest-jni/build.gradle.kts | 2 ++ src/main/java/rocks/kavin/reqwest4j/ReqwestUtils.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/reqwest-jni/build.gradle.kts b/reqwest-jni/build.gradle.kts index c5bff64..3882150 100644 --- a/reqwest-jni/build.gradle.kts +++ b/reqwest-jni/build.gradle.kts @@ -8,5 +8,7 @@ rust { targets += target("aarch64-unknown-linux-gnu", "libreqwest.so") targets += target("x86_64-unknown-linux-gnu", "libreqwest.so") + targets += target("aarch64-apple-darwin", "libreqwest.dylib") + targets += target("x86_64h-apple-darwin", "libreqwest.dylib") targets += target("x86_64-pc-windows-gnu", "libreqwest.dll") } diff --git a/src/main/java/rocks/kavin/reqwest4j/ReqwestUtils.java b/src/main/java/rocks/kavin/reqwest4j/ReqwestUtils.java index 7bc4273..6749b91 100644 --- a/src/main/java/rocks/kavin/reqwest4j/ReqwestUtils.java +++ b/src/main/java/rocks/kavin/reqwest4j/ReqwestUtils.java @@ -26,6 +26,9 @@ public class ReqwestUtils { } else if (os.contains("linux")) { extension = ".so"; native_folder = "linux"; + } else if (os.contains("darwin")) { + extension = ".dylib"; + native_folder = "darwin"; // or apple? } else { throw new RuntimeException("OS not supported"); } From ffb6dfd0488a3a8152ca6f16b062245519de81a2 Mon Sep 17 00:00:00 2001 From: Andrea Spacca Date: Sun, 24 Sep 2023 23:41:19 +0900 Subject: [PATCH 2/2] type on x86_64 apple darwin target --- reqwest-jni/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reqwest-jni/build.gradle.kts b/reqwest-jni/build.gradle.kts index 3882150..a64d5d3 100644 --- a/reqwest-jni/build.gradle.kts +++ b/reqwest-jni/build.gradle.kts @@ -9,6 +9,6 @@ rust { targets += target("aarch64-unknown-linux-gnu", "libreqwest.so") targets += target("x86_64-unknown-linux-gnu", "libreqwest.so") targets += target("aarch64-apple-darwin", "libreqwest.dylib") - targets += target("x86_64h-apple-darwin", "libreqwest.dylib") + targets += target("x86_64-apple-darwin", "libreqwest.dylib") targets += target("x86_64-pc-windows-gnu", "libreqwest.dll") }