Skip to content

Commit

Permalink
Merge pull request #14 from Kobzol/split-debuginfo
Browse files Browse the repository at this point in the history
Add support for split debuginfo
  • Loading branch information
Kobzol authored Mar 11, 2024
2 parents 01ad171 + 223b0bd commit 9232b5d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Add support for the `incremental` profile attribute.
- Set all performance-related default properties from the base profile (dev/release) on
templates (https://github.com/Kobzol/cargo-wizard/issues/4).
- Add support for the `split-debuginfo` profile attribute.

# 0.2.1 (10. 3. 2024)

Expand Down
6 changes: 6 additions & 0 deletions src/dialog/known_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ impl KnownCargoOptions {
TemplateItemId::TargetCpuInstructionSet,
TemplateItemId::Panic,
TemplateItemId::DebugInfo,
TemplateItemId::SplitDebugInfo,
TemplateItemId::Strip,
TemplateItemId::Incremental,
TemplateItemId::Linker,
Expand Down Expand Up @@ -317,6 +318,11 @@ impl KnownCargoOptions {
TemplateItemId::Incremental => MetadataBuilder::default()
.bool("Enable", true)
.bool("Disable", false)
.build(),
TemplateItemId::SplitDebugInfo => MetadataBuilder::default()
.string("Off", "off")
.string("Packed debuginfo", "packed")
.string("Unpacked debuginfo", "unpacked")
.build()
}
}
Expand Down
1 change: 1 addition & 0 deletions src/dialog/prompts/customize_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ impl Display for ItemId {
TemplateItemId::FrontendThreads => "Amount of frontend threads",
TemplateItemId::Linker => "Linker",
TemplateItemId::Incremental => "Incremental compilation",
TemplateItemId::SplitDebugInfo => "Split debug info",
};
f.write_str(description)
}
Expand Down
1 change: 1 addition & 0 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pub fn release_profile() -> TemplateBuilder {
pub enum TemplateItemId {
// Do not forget to modify CargoKnownOptions when adding new variants to this enum
DebugInfo,
SplitDebugInfo,
Strip,
Lto,
CodegenUnits,
Expand Down
3 changes: 2 additions & 1 deletion src/workspace/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ impl CargoConfig {
| TemplateItemId::Panic
| TemplateItemId::OptimizationLevel
| TemplateItemId::CodegenBackend
| TemplateItemId::Incremental => None,
| TemplateItemId::Incremental
| TemplateItemId::SplitDebugInfo => None,
}
})
.collect();
Expand Down
1 change: 1 addition & 0 deletions src/workspace/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ impl CargoManifest {
fn id_to_item_name(id: TemplateItemId) -> Option<&'static str> {
match id {
TemplateItemId::DebugInfo => Some("debug"),
TemplateItemId::SplitDebugInfo => Some("split-debuginfo"),
TemplateItemId::Strip => Some("strip"),
TemplateItemId::Lto => Some("lto"),
TemplateItemId::CodegenUnits => Some("codegen-units"),
Expand Down

0 comments on commit 9232b5d

Please sign in to comment.