diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3f5fe9851fe..5f12b5acb01 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,14 +20,14 @@ jobs: platform: - os: 'ubuntu-latest' arch: 'x86_64-unknown-linux-gnu' - dir: 'linux64' + dir: 'linux_x86_64' dependency_script: "sudo apt-get update && sudo apt-get install -y bison flex binutils-dev" - os: 'macos-latest' arch: 'x86_64-apple-darwin' - dir: 'osx64' + dir: 'mac_x86_64' dependency_script: "brew install bison flex curl binutils" - os: 'windows-latest' - dir: 'win64' + dir: 'win_x86_64' arch: 'x86_64-pc-windows-msvc' dependency_script: | choco install visualstudio2017buildtools diff --git a/Ghidra/Features/Decompiler/build.gradle b/Ghidra/Features/Decompiler/build.gradle index 64d3e796cf7..ae113549c3c 100644 --- a/Ghidra/Features/Decompiler/build.gradle +++ b/Ghidra/Features/Decompiler/build.gradle @@ -383,55 +383,73 @@ def getTargetArch() { } task win64BuildDecompilerRust(type: Exec) { - workingDir "./src/decompile" + if (isCurrentWindows()) { + exec { + workingDir "./src/decompile" - def arch = null + def arch = null - 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/win64' + 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' + } + } } task linux64BuildDecompilerRust(type: Exec) { - workingDir "./src/decompile" + if (isCurrentLinux()) { + exec { + workingDir "./src/decompile" - def arch = null + def out_path = null + def arch = null - try { - arch = getTargetArch() - } catch (Exception e) { - throw new TaskExecutionException(it, e) - } - - 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', '../../build/os/linux64' + 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" + if (isCurrentMac()) { + exec { + workingDir "./src/decompile" + def out_path = null + def arch = null + + try { + arch = getTargetArch() + } catch (Exception e) { + throw new TaskExecutionException(it, e) + } - def arch = null + if (arch == "aarch64") { + out_path = "../../build/os/mac_arm_64" + } else { + out_path = "../../build/os/mac_x86_64" + } - try { - arch = getTargetArch() - } catch (Exception e) { - throw new TaskExecutionException(it, e) + def target = "${arch}-apple-darwin" + commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', out_path + } } - - def target = "${arch}-apple-darwin" - - commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/osx64' - } model {