Roc linker library base setup

This commit is contained in:
Brendan Hansknecht 2021-08-16 20:06:44 -07:00
parent d5058041b0
commit c6217ebfdb
10 changed files with 151 additions and 0 deletions

34
linker/src/lib.rs Normal file
View file

@ -0,0 +1,34 @@
use clap::{App, AppSettings, Arg};
use std::io;
pub const CMD_PREPROCESS: &str = "preprocess";
pub const CMD_SURGERY: &str = "surgery";
pub const EXEC: &str = "EXEC";
pub const SHARED_LIB: &str = "SHARED_LIB";
pub fn build_app<'a>() -> App<'a> {
App::new("link")
.about("Preprocesses a platform and surgically links it to an application.")
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand(
App::new(CMD_PREPROCESS)
.about("Preprocesses a dynamically linked platform to prepare for linking.")
.arg(
Arg::with_name(EXEC)
.help("The dynamically link platform executable")
.required(true),
)
.arg(
Arg::with_name(SHARED_LIB)
.help("The dummy shared library representing the Roc application")
.required(true),
),
)
.subcommand(
App::new(CMD_SURGERY).about("Links a preprocessed platform with a Roc application."),
)
}
pub fn preprocess() -> io::Result<()> {
panic!("sad");
}