Skip to content

Commit

Permalink
feat: Added option to skip stripping elf
Browse files Browse the repository at this point in the history
  • Loading branch information
nikarh committed Apr 2, 2024
1 parent f3a4db4 commit ed2fb80
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ title_name = "My application"
assets = "static"
# Optional, this is the default
build_std = "std,panic_unwind"
# Optional, true by default. Will strip debug symbols from the resulting elf
strip = true
# Optional, this is the default
vita_strip_flags = ["-g"]
# Optional, this is the default
Expand Down
5 changes: 5 additions & 0 deletions src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ impl<'a> BuildContext<'a> {
}

fn strip(&self, art: &ExecutableArtifact) -> anyhow::Result<()> {
if !art.meta.strip {
info!("{}", "Skipping elf strip".yellow());
return Ok(());
}

let mut command = Command::new(self.sdk_binary("arm-vita-eabi-strip"));

command
Expand Down
7 changes: 7 additions & 0 deletions src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ impl FromStr for TitleId {
}
}

fn default_strip() -> bool {
true
}

fn default_build_std() -> String {
"std,panic_unwind".to_string()
}
Expand All @@ -81,6 +85,8 @@ pub struct PackageMetadata {
pub assets: Option<String>,
#[serde(default = "default_build_std")]
pub build_std: String,
#[serde(default = "default_strip")]
pub strip: bool,
#[serde(default = "default_vita_strip_flags")]
pub vita_strip_flags: Vec<String>,
#[serde(default = "default_vita_make_fself_flags")]
Expand All @@ -96,6 +102,7 @@ impl Default for PackageMetadata {
title_name: None,
assets: None,
build_std: default_build_std(),
strip: default_strip(),
vita_strip_flags: default_vita_strip_flags(),
vita_make_fself_flags: default_vita_make_fself_flags(),
vita_mksfoex_flags: default_vita_mksfoex_flags(),
Expand Down

0 comments on commit ed2fb80

Please sign in to comment.