Skip to content

Commit 2719740

Browse files
author
Anciety
authored
Merge pull request #54 from ioo0s/master
fix workflow
2 parents 8b8b684 + ac8ddd9 commit 2719740

File tree

2 files changed

+54
-36
lines changed

2 files changed

+54
-36
lines changed

.github/workflows/main.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
platform:
2121
- os: 'ubuntu-latest'
2222
arch: 'x86_64-unknown-linux-gnu'
23-
dir: 'linux64'
23+
dir: 'linux_x86_64'
2424
dependency_script: "sudo apt-get update && sudo apt-get install -y bison flex binutils-dev"
2525
- os: 'macos-latest'
2626
arch: 'x86_64-apple-darwin'
27-
dir: 'osx64'
27+
dir: 'mac_x86_64'
2828
dependency_script: "brew install bison flex curl binutils"
2929
- os: 'windows-latest'
30-
dir: 'win64'
30+
dir: 'win_x86_64'
3131
arch: 'x86_64-pc-windows-msvc'
3232
dependency_script: |
3333
choco install visualstudio2017buildtools

Ghidra/Features/Decompiler/build.gradle

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -374,55 +374,73 @@ def getTargetArch() {
374374
}
375375

376376
task win64BuildDecompilerRust(type: Exec) {
377-
workingDir "./src/decompile"
377+
if (isCurrentWindows()) {
378+
exec {
379+
workingDir "./src/decompile"
378380

379-
def arch = null
381+
def arch = null
380382

381-
try {
382-
arch = getTargetArch()
383-
} catch (Exception e) {
384-
throw new TaskExecutionException(it, e)
385-
}
386-
387-
def target = "${arch}-pc-windows-msvc"
388-
389-
390-
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/win64'
383+
try {
384+
arch = getTargetArch()
385+
} catch (Exception e) {
386+
throw new TaskExecutionException(it, e)
387+
}
391388

389+
def target = "${arch}-pc-windows-msvc"
390+
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/win_x86_64'
391+
}
392+
}
392393
}
393394

394395
task linux64BuildDecompilerRust(type: Exec) {
395-
workingDir "./src/decompile"
396+
if (isCurrentLinux()) {
397+
exec {
398+
workingDir "./src/decompile"
396399

397-
def arch = null
400+
def out_path = null
401+
def arch = null
398402

399-
try {
400-
arch = getTargetArch()
401-
} catch (Exception e) {
402-
throw new TaskExecutionException(it, e)
403-
}
404-
405-
def target = "${arch}-unknown-linux-gnu"
403+
try {
404+
arch = getTargetArch()
405+
} catch (Exception e) {
406+
throw new TaskExecutionException(it, e)
407+
}
406408

407-
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/linux64'
409+
if (arch == "aarch64") {
410+
out_path = "../../build/os/linux_arm_64"
411+
} else {
412+
out_path = "../../build/os/linux_x86_64"
413+
}
408414

415+
def target = "${arch}-unknown-linux-gnu"
416+
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', out_path
417+
}
418+
}
409419
}
410420

411421
task osx64BuildDecompilerRust(type: Exec) {
412-
workingDir "./src/decompile"
422+
if (isCurrentMac()) {
423+
exec {
424+
workingDir "./src/decompile"
425+
def out_path = null
426+
def arch = null
427+
428+
try {
429+
arch = getTargetArch()
430+
} catch (Exception e) {
431+
throw new TaskExecutionException(it, e)
432+
}
413433

414-
def arch = null
434+
if (arch == "aarch64") {
435+
out_path = "../../build/os/mac_arm_64"
436+
} else {
437+
out_path = "../../build/os/mac_x86_64"
438+
}
415439

416-
try {
417-
arch = getTargetArch()
418-
} catch (Exception e) {
419-
throw new TaskExecutionException(it, e)
440+
def target = "${arch}-apple-darwin"
441+
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', out_path
442+
}
420443
}
421-
422-
def target = "${arch}-apple-darwin"
423-
424-
commandLine 'cargo', 'build', '--release', '--target', target, '-Z', 'unstable-options', '--out-dir', '../../build/os/osx64'
425-
426444
}
427445

428446
model {

0 commit comments

Comments
 (0)