Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge branch 'patch'

ghidra15fa4e7a22545
diff --cc GPL/nativeBuildProperties.gradle
index f46962b4cb,132c9e2f75..96e6f96f51
--- a/GPL/nativeBuildProperties.gradle
+++ b/GPL/nativeBuildProperties.gradle
@@@ -208,24 -221,5 +221,31 @@@ tasks.addRule("Pattern: prebuildNatives
}
}
+/*****************************************************************************************
+ * The following block of code changes the output directory for native builds
+ * to <projectDir>/build/os/<platform>/<executable> ?? is there a better way to do this?
+ ****************************************************************************************/
+gradle.taskGraph.whenReady {
+ def p = this.project
+ p.tasks.withType(LinkExecutable).each { t ->
+ File f = t.linkedFile.getAsFile().get()
+ String filename = f.getName()
+ NativePlatform platform = t.targetPlatform.get()
+ String osName = platform.getName()
+ t.linkedFile = p.file("build/os/${osName}/$filename")
+ }
+ p.tasks.withType(LinkSharedLibrary).each { t ->
+ File f = t.linkedFile.getAsFile().get()
+ String filename = f.getName()
+ NativePlatform platform = t.targetPlatform.get()
+ String osName = platform.getName()
+ t.linkedFile = p.file("build/os/${osName}/$filename")
+ }
+}
++
++/*****************************************************************************************
++ * The following block of code ensures that the buildNatives_<platform> task is used
++ * during assembly to ensure that missing toolchain generates an appropriate error
++ ****************************************************************************************/
+ def currentPlatform = getCurrentPlatformName()
+ assemble.dependsOn "buildNatives_$currentPlatform"