From 56a8874ed6043a86a35f685fc0f1116584eaa7af Mon Sep 17 00:00:00 2001 From: ioo0s Date: Mon, 13 Sep 2021 12:41:30 +0800 Subject: [PATCH] fix out_dir error for BuildDecompilerRust --- Ghidra/Features/Decompiler/build.gradle | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Ghidra/Features/Decompiler/build.gradle b/Ghidra/Features/Decompiler/build.gradle index 7335d13a16c..d4939628b47 100644 --- a/Ghidra/Features/Decompiler/build.gradle +++ b/Ghidra/Features/Decompiler/build.gradle @@ -387,13 +387,14 @@ task win64BuildDecompilerRust(type: Exec) { def target = "${arch}-pc-windows-msvc" - commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/win64' + 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 { @@ -402,15 +403,22 @@ task linux64BuildDecompilerRust(type: Exec) { throw new TaskExecutionException(it, e) } + 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', '../../build/os/linux64' + 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 { @@ -419,9 +427,15 @@ task osx64BuildDecompilerRust(type: Exec) { 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" - commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/osx64' + commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', out_path }