create a roc sub command for generating a dummy lib

This commit is contained in:
Brendan Hansknecht 2022-10-22 19:20:42 -07:00
parent f0b65048cd
commit d6bdd2aec7
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
5 changed files with 90 additions and 3 deletions

View file

@ -44,6 +44,7 @@ pub const CMD_VERSION: &str = "version";
pub const CMD_FORMAT: &str = "format";
pub const CMD_TEST: &str = "test";
pub const CMD_GLUE: &str = "glue";
pub const CMD_GEN_DUMMY_LIB: &str = "gen-dummy-lib";
pub const FLAG_DEBUG: &str = "debug";
pub const FLAG_DEV: &str = "dev";
@ -276,6 +277,23 @@ pub fn build_app<'a>() -> Command<'a> {
.required(true)
)
)
.subcommand(Command::new(CMD_GEN_DUMMY_LIB)
.about("Generate a dummy shared library that can be used for linking a platform binary")
.arg(
Arg::new(ROC_FILE)
.help("The .roc file for an app using the platform")
.allow_invalid_utf8(true)
.required(true)
)
.arg(
Arg::new(FLAG_TARGET)
.long(FLAG_TARGET)
.help("Choose a different target")
.default_value(Target::default().as_str())
.possible_values(Target::OPTIONS)
.required(false),
)
)
.trailing_var_arg(true)
.arg(flag_optimize)
.arg(flag_max_threads.clone())