Skip to content

Commit

Permalink
Merge pull request #37 from lf-lang/patch-tassilo-lingo-init
Browse files Browse the repository at this point in the history
`Native` used as default platform
  • Loading branch information
lhstrh authored Sep 5, 2023
2 parents bbb0b6f + a68079f commit ed352e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ pub struct InitArgs {
#[clap(value_enum, short, long)]
pub language: Option<TargetLanguage>,

#[clap(value_enum, short, long)]
pub platform: Option<Platform>,
#[clap(value_enum, short, long, default_value_t = Platform::Native)]
pub platform: Platform,
}
impl InitArgs {
pub fn get_target_language(&self) -> TargetLanguage {
self.language.unwrap_or({
// Target language for Zephyr is C, else Cpp.
match self.platform {
Some(Platform::Zephyr) => TargetLanguage::C,
Platform::Zephyr => TargetLanguage::C,
_ => TargetLanguage::Cpp,
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl ConfigFile {
name: Some(spec.name),
main_reactor: Some(spec.path),
target: spec.target,
platform: init_args.platform,
platform: Some(init_args.platform),
dependencies: HashMap::new(),
properties: HashMap::new(),
})
Expand Down

0 comments on commit ed352e8

Please sign in to comment.