Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added option to skip stripping elf #20

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 when enabled.
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