Skip to content

Commit

Permalink
Merge pull request #4 from breadrock1/improve/add-else-platforms
Browse files Browse the repository at this point in the history
Improve: Added loading library with extension .so as default
  • Loading branch information
breadrock1 authored Jul 9, 2024
2 parents 1b5596e + ad6c62a commit 6857ac4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/example/adblock/LoadLibraryHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ private static String buildLibraryPath() throws RustException {
* This method generate extension by current system platform.
*
* @return String A native library extension by system platform.
* @throws RustException throws if failed to detect system platform.
*/
private static String buildLibraryExtension() throws RustException{
private static String buildLibraryExtension() {
String osName = System.getProperty("os.name").toLowerCase();
if (osName.contains("windows")) {
return ".dll";
} else if (osName.contains("mac os x")) {
return ".dylib";
} else if (osName.contains("linux")) {
} if (osName.contains("linux")) {
return ".so";
} else {
throw new RustException("Unsupported OS: " + osName);
System.err.println("Unsupported OS: " + osName);
return ".so";
}
}

Expand Down

0 comments on commit 6857ac4

Please sign in to comment.