Make stripSymbols a gradle property

This commit is contained in:
TSR Berry 2023-07-21 00:55:38 +02:00 committed by Emmanuel Hansen
parent 992ee1c825
commit 6ea9497d31
2 changed files with 30 additions and 8 deletions

View File

@ -25,5 +25,11 @@ android.nonTransitiveRClass=true
# It needs to be set to either "debug" or "release" and can also be overriden on a per build basis
# by adding -Dorg.ryujinx.config=NAME to the command line.
org.ryujinx.config=debug
# Output path of libRyujinx.so
# Controls stripping of symbols from libryujinx
# Setting this property to auto causes symbols to be stripped for release builds,
# but not for debug builds.
# Valid values are: ["auto", "-1", "true", "1", "false", "0"]
# Default: auto
org.ryujinx.symbols.strip=auto
# Output path of libryujinx.so
org.ryujinx.publish.path=app/src/main/jniLibs/arm64-v8a

View File

@ -14,13 +14,21 @@ def publishDirectory = providers.gradleProperty("org.ryujinx.publish.path").getO
// Should the symbols be stripped from the published library?
// Per default the symbols will be stripped for release builds, but not for debug builds.
// This can be overridden using this property.
// Valid values are: ["true", "1", "false", "0"]
def stripSymbols = false
if (project.hasProperty("org.ryujinx.symbols.strip")) {
stripSymbols = project.property("org.ryujinx.symbols.strip") == "true" || project.property("org.ryujinx.symbols.strip") == "1"
}
else {
stripSymbols = configuration == "release"
// Valid values are: ["auto", "-1", "true", "1", "false", "0"]
def stripSymbols = providers.gradleProperty("org.ryujinx.symbols.strip").getOrElse("")
//noinspection GroovyFallthrough
switch (stripSymbols) {
case "true":
case "1":
stripSymbols = true
break
case "false":
case "0":
stripSymbols = false
break
default:
stripSymbols = configuration == "release"
break
}
// Additional arguments for the dotnet publish command.
def additionalArgs = project.hasProperty("org.ryujinx.args") ? project.property("org.ryujinx.args") : ""
@ -55,6 +63,13 @@ tasks.register('compileLibRyujinx', Exec) {
environment "PATH", "${toolchainPath}:${providers.environmentVariable("PATH").get()}"
}
doFirst {
println "Building LibRyujinx in ${configuration} mode."
println "Configuration:"
println "\tStripSymbols: ${stripSymbols}"
println "\tadditional args: ${additionalArgs.split(" ")}"
}
executable 'dotnet'
args 'publish',
'-r', 'linux-bionic-arm64',
@ -72,6 +87,7 @@ tasks.register('compileLibRyujinx', Exec) {
include '*.so'
into publishDirectory
rename (String originalName) -> originalName.toLowerCase()
duplicatesStrategy 'include'
preserve {
include '.*'
}