OS dependent library loading
Some checks failed
studiorailgun/fluid-sim/pipeline/head There was a failure building this commit

This commit is contained in:
unknown 2024-03-15 20:51:46 -04:00
parent 40b570a0b1
commit 13bda0cbf3

View File

@ -24,10 +24,16 @@ import org.lwjgl.system.MemoryUtil;
*/
public class FluidSim {
/**
* Load fluid sim library
*/
static {
// System.out.println(System.getProperty("user.dir"));
// System.load(System.getProperty("user.dir") + "/shared-folder/libfluidsim.dll");
System.load(new File("./shared-folder/libfluidsim.dll").toPath().toAbsolutePath().toString());
String osName = System.getProperty("os.name");
if(osName.contains("win")){
System.load(new File("./shared-folder/libfluidsim.dll").toPath().toAbsolutePath().toString());
} else if(osName.contains("nix")){
System.load(new File("./shared-folder/libfluidsim.so").toPath().toAbsolutePath().toString());
}
}
public static final int DIM = 18;