Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions arc-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@ task fixWrap{

def f = file("$rootDir/arc-core/jni/build-linux64.xml");
if(f.exists()){
f.text = f.text.replace("-Wl,-wrap,memcpy", "-Wl,-wrap,memcpy,-wrap,pow,-wrap,powf,-wrap,log,-wrap,logf,-wrap,exp,-wrap,expf,-wrap,clock_gettime")
if(System.getProperty("os.name").equals("FreeBSD")){ // other BSDs?
f.text = f.text
.replace("linux", "freebsd")
.replace('-Ijni-headers/${jniPlatform}', "-Ijni-headers/linux")
.replace("gcc", "cc")
.replace("g++", "c++")
.replace("-Wl,-wrap,memcpy", "")
} else {
f.text = f.text.replace("-Wl,-wrap,memcpy", "-Wl,-wrap,memcpy,-wrap,pow,-wrap,powf,-wrap,log,-wrap,logf,-wrap,exp,-wrap,expf,-wrap,clock_gettime")
}
}
}
}
Expand Down Expand Up @@ -118,7 +127,7 @@ task preJni{
task postJni{
doLast{
copy{
from "libs/linux64", "libs/windows32", "libs/windows64", "libs/macosx64"
from "libs/windows32", "libs/windows64", "libs/macosx64", "libs/freebsd64"
into "../natives/natives-desktop/libs"
include "**"
}
Expand Down
20 changes: 18 additions & 2 deletions backends/backend-sdl/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sourceSets.main.java.srcDirs = ["src"]
sourceSets.main.resources.srcDirs = ["libs/linux64", "libs/macosx64","libs/windows32", "libs/windows64", "libs/openal"]
sourceSets.main.resources.srcDirs = ["libs/macosx64","libs/windows32", "libs/windows64", "libs/freebsd64", "libs/openal"]

dependencies {
testImplementation libraries.jnigen
Expand Down Expand Up @@ -126,8 +126,24 @@ jnigen{

}

task postJni{
doFirst{
println "--FIXING FREEBSD SCRIPTS--"
if(System.getProperty("os.name").equals("FreeBSD")) {
def f = file("$rootDir/backends/backend-sdl/jni/build-linux64.xml");
if(f.exists()){
f.text = f.text
.replace("linux", "freebsd")
.replace('-Ijni-headers/${jniPlatform}', "-Ijni-headers/linux")
.replace("gcc", "cc")
.replace("g++", "c++")
}
}
}
}
getTasksByName("jnigen", true).each{
it.dependsOn preJni
it.finalizedBy postJni
it.dependsOn classes
it.dependsOn aproj(":arc-core").getTasksByName("compileJava", true)
}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ subprojects{
}
}
}
}
}
21 changes: 19 additions & 2 deletions extensions/freetype/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,27 @@ task preJni{
}
}

task fixScripts{
doFirst{
if(System.getProperty("os.name").equals("FreeBSD")) {
def f = file("$rootDir/extensions/freetype/jni/build-linux64.xml");
if(f.exists()){
f.text = f.text
.replace("linux", "freebsd")
.replace('-Ijni-headers/${jniPlatform}', "-Ijni-headers/linux")
.replace("gcc", "cc")
.replace("g++", "c++")
.replace("-Wl,-wrap,memcpy", "")
}
}
}
}

//copies files into the right locations
task postJni{
doLast{
copy{
from "libs/linux64", "libs/windows32", "libs/windows64", "libs/macosx64"
from "libs/windows32", "libs/windows64", "libs/macosx64", "libs/freebsd64"
into "../../natives/natives-freetype-desktop/libs"
include "**"
}
Expand All @@ -107,4 +123,5 @@ jnigenBuild.finalizedBy postJni

getTasksByName("jnigen", true).each{
it.dependsOn preJni
}
it.finalizedBy fixScripts
}