Skip to content

Commit

Permalink
Merge branch 'master' of github.com:StarCrossPortal/ghidracraft
Browse files Browse the repository at this point in the history
  • Loading branch information
Anciety committed Oct 9, 2021
2 parents 36b1cd2 + 2719740 commit 55a5086
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
84 changes: 51 additions & 33 deletions Ghidra/Features/Decompiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 55a5086

Please sign in to comment.