From 5c9e7fa7f5cc233223fa7c8338a37b422118d143 Mon Sep 17 00:00:00 2001 From: Andrea Spacca Date: Sun, 24 Sep 2023 13:22:59 +0900 Subject: [PATCH] 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"); }