File tree 2 files changed +12
-3
lines changed
src/main/java/io/github/benjaminamos/tracy
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 3
3
4
4
package io .github .benjaminamos .tracy ;
5
5
6
- import java .nio . file . Paths ;
6
+ import java .io . File ;
7
7
8
8
public final class Tracy {
9
9
private Tracy () {
@@ -12,9 +12,17 @@ private Tracy() {
12
12
static {
13
13
String libraryPath = System .getProperty ("org.terasology.librarypath" );
14
14
if (libraryPath == null ) {
15
- System .loadLibrary ("tracy-jni" );
15
+ System .loadLibrary ("tracy-jni-" + System . getProperty ( "os.arch" ) );
16
16
} 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
+ }
18
26
}
19
27
}
20
28
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ plugins {
10
10
version = " 1.0.0"
11
11
12
12
library {
13
+ baseName = " tracy-jni-" + System .getProperty(" os.arch" )
13
14
source.from(file(" src" ))
14
15
privateHeaders.from(
15
16
file(" src" ), file(" tracy/public" ),
You can’t perform that action at this time.
0 commit comments