-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package us.ihmc.etherCAT; | ||
|
||
import us.ihmc.tools.nativelibraries.NativeLibraryDescription; | ||
import us.ihmc.tools.nativelibraries.NativeLibraryLoader; | ||
import us.ihmc.tools.nativelibraries.NativeLibraryWithDependencies; | ||
|
||
public class soemJavaNativeLibrary implements NativeLibraryDescription | ||
{ | ||
@Override | ||
public String getPackage(OperatingSystem os, Architecture arch) | ||
{ | ||
return "us.ihmc.soem.generated"; | ||
} | ||
|
||
@Override | ||
public NativeLibraryWithDependencies getLibraryWithDependencies(OperatingSystem os, Architecture arch) | ||
{ | ||
if (os == OperatingSystem.LINUX64) | ||
{ | ||
return NativeLibraryWithDependencies.fromFilename("libsoemJava.so"); | ||
} | ||
throw new RuntimeException("Unsupported platform: " + os.name() + "-" + arch.name()); | ||
} | ||
|
||
private static boolean loaded = false; | ||
|
||
public static boolean load() | ||
{ | ||
if (!loaded) | ||
{ | ||
soemJavaNativeLibrary lib = new soemJavaNativeLibrary(); | ||
loaded = NativeLibraryLoader.loadLibrary(lib); | ||
} | ||
return loaded; | ||
} | ||
} |