ghidra/GPL/DemanglerGnu/build.gradle

169 lines
4 KiB
Groovy
Raw Normal View History

2021-03-17 22:22:43 +00:00
/* ###
* IP: Public Domain
*/
2019-06-13 18:06:13 +00:00
if (findProject(':Generic') != null) {
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGPLModule.gradle"
}
else {
apply from: "../utils.gradle"
apply from: "../nativePlatforms.gradle"
2019-06-13 18:06:13 +00:00
apply from: "../nativeBuildProperties.gradle"
}
2019-03-26 17:45:32 +00:00
2019-06-13 18:06:13 +00:00
apply plugin: 'eclipse'
2019-03-26 17:45:32 +00:00
2019-06-13 18:06:13 +00:00
eclipse.project.name = 'GPL DemanglerGnu'
2019-03-26 17:45:32 +00:00
def v33_1 = "demangler_gnu_v2_33_1"
def v24 = "demangler_gnu_v2_24"
def srcVersion33_1 = "src/demangler_gnu_v2_33_1"
def srcVersion24 = "src/demangler_gnu_v2_24"
2019-03-26 17:45:32 +00:00
/**
* This project has some native 'c' code we need to include in the zip for licensing
* and build reasons. So include them here, but we have to do something special: the
* source is divided up into folders for makefiles, headers and .c files:
* /headers
* /c
* /build
*
* The contents of all these need to be merged into the same folder for distribution.
* Hence the following 3 'from' clauses:
*/
task zipBuildableSource(type:Zip) {
group 'private'
description "Collects the source files needed to build this module."
2021-04-12 15:07:06 +00:00
archiveBaseName = project.name + "-src-for-build"
archiveExtension = 'zip'
//
// Version 2.33.1
//
from (project.projectDir.toString() + "/" + srcVersion33_1 + "c") {
into "/" + srcVersion33_1
}
from (project.projectDir.toString() + "/" + srcVersion33_1 + "/headers") {
into "/" + srcVersion33_1
2019-03-26 17:45:32 +00:00
}
from (project.projectDir.toString() + "/" + srcVersion33_1 + "/build") {
into "/" + srcVersion33_1
2019-03-26 17:45:32 +00:00
}
from (project.projectDir.toString() + "/" + srcVersion33_1 + "/README.txt")
//
// Version 2.24
//
from (project.projectDir.toString() + "/" + srcVersion24 + "c") {
into "/" + srcVersion24
2019-03-26 17:45:32 +00:00
}
from (project.projectDir.toString() + "/" + srcVersion24 + "/headers") {
into "/" + srcVersion24
}
from (project.projectDir.toString() + "/" + srcVersion24 + "/build") {
into "/" + srcVersion24
}
from (project.projectDir.toString() + "/" + srcVersion24 + "/README.txt")
2019-03-26 17:45:32 +00:00
}
model {
//
// Version 2.33.1
//
2019-03-26 17:45:32 +00:00
components {
demangler_gnu_v2_33_1(NativeExecutableSpec) {
targetPlatform "win_x86_64"
targetPlatform "linux_x86_64"
targetPlatform "linux_arm_64"
targetPlatform "mac_x86_64"
targetPlatform "mac_arm_64"
2019-03-26 17:45:32 +00:00
sources {
c {
source {
srcDir srcVersion33_1 + "/c"
2019-03-26 17:45:32 +00:00
}
exportedHeaders {
srcDir srcVersion33_1 + "/headers"
2019-03-26 17:45:32 +00:00
}
}
}
2019-03-26 17:45:32 +00:00
}
//
// Version 2.24
//
demangler_gnu_v2_24(NativeExecutableSpec) {
targetPlatform "win_x86_64"
targetPlatform "linux_x86_64"
targetPlatform "linux_arm_64"
targetPlatform "mac_x86_64"
targetPlatform "mac_arm_64"
sources {
c {
source {
srcDir srcVersion24 + "/c"
}
exportedHeaders {
srcDir srcVersion24 + "/headers"
}
}
}
}
2019-03-26 17:45:32 +00:00
}
}
model {
binaries {
/*
Note: 'all' will pass all binary output, which is each platform for each version
*/
2019-03-26 17:45:32 +00:00
all{ b ->
def version = b.getApplication().getName()
if (version.equals(v33_1)) {
if (toolChain in Gcc) {
//cCompiler.args "-DCP_DEMANGLE_DEBUG"
cCompiler.args "-DHAVE_STDLIB_H"
cCompiler.args "-DHAVE_STRING_H"
}
else if (toolChain in VisualCpp) {
cCompiler.args "/D_CONSOLE"
cCompiler.args "-DHAVE_STDLIB_H"
cCompiler.args "-DHAVE_STRING_H"
}
else if (toolChain in Clang) {
cCompiler.args "-DHAVE_STDLIB_H"
cCompiler.args "-DHAVE_STRING_H"
2019-03-26 17:45:32 +00:00
}
}
else if (version.equals(v24)) {
if (toolChain in Gcc) {
cCompiler.args "-DMAIN_CPLUS_DEM"
cCompiler.args "-DHAVE_STDLIB_H"
cCompiler.args "-DHAVE_STRING_H"
}
else if (toolChain in VisualCpp) {
cCompiler.args "/D_CONSOLE"
cCompiler.args "/DMAIN_CPLUS_DEM"
cCompiler.args "-DHAVE_STDLIB_H"
cCompiler.args "-DHAVE_STRING_H"
}
else if (toolChain in Clang) {
cCompiler.args "-DMAIN_CPLUS_DEM"
cCompiler.args "-DHAVE_STDLIB_H"
cCompiler.args "-DHAVE_STRING_H"
2019-03-26 17:45:32 +00:00
}
}
2019-03-26 17:45:32 +00:00
}
}
}