Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Commit

Permalink
Strip executable in release build (#503)
Browse files Browse the repository at this point in the history
This will drastically reduce release artifact sizes to make more room in
the WPILib installer.
  • Loading branch information
calcmogul authored Aug 21, 2023
1 parent 89a81bb commit fd8ccfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions sysid-application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,14 @@ model {
'-framework' << 'Cocoa' << '-framework' << 'IOKit' << '-framework' <<
'CoreFoundation' << '-framework' << 'CoreVideo' << '-framework' << 'QuartzCore'
it.linker.args << '-framework' << 'Kerberos'
if (it.buildType.getName() == "release") {
it.linker.args << '-s'
}
} else {
it.linker.args << '-lX11'
if (it.buildType.getName() == "release") {
it.linker.args << '-s'
}
}

// Define NDEBUG in Release Mode (needed for proper wpi::Logger functionality).
Expand Down
3 changes: 2 additions & 1 deletion sysid-application/config/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ model {
from("../LICENSE.md") { into '/' }
from("../ThirdPartyNotices.txt") { into '/' }
from(exe)
if (binary.targetPlatform.operatingSystem.isWindows()) {
if (binary.targetPlatform.operatingSystem.isWindows() &&
!binary.name.contains("release")) {
def exePath = binary.executable.file.absolutePath
exePath = exePath.substring(0, exePath.length() - 4)
def pdbPath = new File(exePath + '.pdb')
Expand Down

0 comments on commit fd8ccfc

Please sign in to comment.