add macos support

This commit is contained in:
Andrea Spacca 2023-09-24 13:22:59 +09:00
parent 52bb8f76e4
commit 5c9e7fa7f5
2 changed files with 5 additions and 0 deletions

View file

@ -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")
}

View file

@ -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");
}