File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
src/main/java/io/github/benjaminamos/tracy Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 33
44package io .github .benjaminamos .tracy ;
55
6- import java .nio . file . Paths ;
6+ import java .io . File ;
77
88public final class Tracy {
99 private Tracy () {
@@ -12,9 +12,17 @@ private Tracy() {
1212 static {
1313 String libraryPath = System .getProperty ("org.terasology.librarypath" );
1414 if (libraryPath == null ) {
15- System .loadLibrary ("tracy-jni" );
15+ System .loadLibrary ("tracy-jni-" + System . getProperty ( "os.arch" ) );
1616 } else {
17- System .load (Paths .get (libraryPath + "/tracy-jni.dll" ).toAbsolutePath ().toString ());
17+ File libraryDirectory = new File (libraryPath );
18+ if (libraryDirectory .exists () && libraryDirectory .isDirectory ()) {
19+ String architecture = System .getProperty ("os.arch" );
20+ for (File file : libraryDirectory .listFiles ()) {
21+ if (file .getName ().startsWith ("tracy-jni-" + architecture ) || file .getName ().startsWith ("libtracy-jni" + architecture )) {
22+ System .load (file .getPath ());
23+ }
24+ }
25+ }
1826 }
1927 }
2028
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ plugins {
1010version = " 1.0.0"
1111
1212library {
13+ baseName = " tracy-jni-" + System .getProperty(" os.arch" )
1314 source.from(file(" src" ))
1415 privateHeaders.from(
1516 file(" src" ), file(" tracy/public" ),
You can’t perform that action at this time.
0 commit comments