@@ -38,16 +38,21 @@ public class NativeLibraryLoader {
38
38
// For Android, os.name is also "Linux", so we need an extra check
39
39
boolean android = System .getProperty ("java.vendor" ).contains ("Android" );
40
40
if (!android ) {
41
- String osName = System .getProperty ("os.name" );
41
+ String osName = System .getProperty ("os.name" ). toLowerCase () ;
42
42
String sunArch = System .getProperty ("sun.arch.data.model" );
43
- if (osName .contains ("Windows" )) {
44
- libname += "-windows" + ("32" .equals (sunArch ) ? "-x86" : "-x64" );
43
+ String cpuArchPostfix = "32" .equals (sunArch ) ? "-x86" : "-x64" ;
44
+ if (osName .contains ("windows" )) {
45
+ libname += "-windows" + cpuArchPostfix ;
45
46
filename = libname + ".dll" ;
46
47
checkUnpackLib (filename );
47
- } else if (osName .contains ("Linux " )) {
48
- libname += "-linux" + ( "32" . equals ( sunArch ) ? "-x86" : "-x64" ) ;
48
+ } else if (osName .contains ("linux " )) {
49
+ libname += "-linux" + cpuArchPostfix ;
49
50
filename = "lib" + libname + ".so" ;
50
51
checkUnpackLib (filename );
52
+ } else if (osName .contains ("mac" )) {
53
+ libname += "-macos" + cpuArchPostfix ;
54
+ filename = "lib" + libname + ".dylib" ;
55
+ checkUnpackLib (filename );
51
56
}
52
57
}
53
58
File file = new File (filename );
0 commit comments