Skip to content

Commit

Permalink
fix exec for BuildDecompilerRust
Browse files Browse the repository at this point in the history
  • Loading branch information
ioo0s committed Sep 13, 2021
1 parent 56a8874 commit a74c8bf
Showing 1 changed file with 51 additions and 49 deletions.
100 changes: 51 additions & 49 deletions Ghidra/Features/Decompiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -374,69 +374,71 @@ def getTargetArch() {
}

task win64BuildDecompilerRust(type: Exec) {
workingDir "./src/decompile"

def arch = null
if (isCurrentWindows()) {
exec {
def arch = null

try {
arch = getTargetArch()
} catch (Exception e) {
throw new TaskExecutionException(it, e)
}

try {
arch = getTargetArch()
} catch (Exception e) {
throw new TaskExecutionException(it, e)
def target = "${arch}-pc-windows-msvc"
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/win_x86_64'
}
}

def target = "${arch}-pc-windows-msvc"


commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/win_x86_64'

}

task linux64BuildDecompilerRust(type: Exec) {
workingDir "./src/decompile"

def out_path = null
def arch = null

try {
arch = getTargetArch()
} catch (Exception e) {
throw new TaskExecutionException(it, e)
}

if (arch == "aarch64") {
out_path = "../../build/os/linux_arm_64"
} else {
out_path = "../../build/os/linux_x86_64"
}
if (isCurrentLinux()) {
exec {
workingDir "./src/decompile"

def out_path = null
def arch = null

def target = "${arch}-unknown-linux-gnu"
try {
arch = getTargetArch()
} catch (Exception e) {
throw new TaskExecutionException(it, e)
}

commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', out_path
if (arch == "aarch64") {
out_path = "../../build/os/linux_arm_64"
} else {
out_path = "../../build/os/linux_x86_64"
}

def target = "${arch}-unknown-linux-gnu"
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', out_path
}
}
}

task osx64BuildDecompilerRust(type: Exec) {
workingDir "./src/decompile"
def out_path = null
def arch = null

try {
arch = getTargetArch()
} catch (Exception e) {
throw new TaskExecutionException(it, e)
}

if ( arch == "aarch64" ) {
out_path = "../../build/os/mac_arm_64"
}else {
out_path = "../../build/os/mac_x86_64"
}

def target = "${arch}-apple-darwin"
if (isCurrentMac()) {
exec {
workingDir "./src/decompile"
def out_path = null
def arch = null

try {
arch = getTargetArch()
} catch (Exception e) {
throw new TaskExecutionException(it, e)
}

commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', out_path
if (arch == "aarch64") {
out_path = "../../build/os/mac_arm_64"
} else {
out_path = "../../build/os/mac_x86_64"
}

def target = "${arch}-apple-darwin"
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', out_path
}
}
}

model {
Expand Down

0 comments on commit a74c8bf

Please sign in to comment.