1
Fork 0

Merge commit 'b385428e3d' into subtree-update_cg_gcc_2024-03-05

This commit is contained in:
Guillaume Gomez 2024-03-05 19:58:36 +01:00
commit 0d359efbe6
76 changed files with 7183 additions and 4278 deletions

View file

@ -2,12 +2,18 @@ use std::env;
use std::process;
mod build;
mod cargo;
mod clean;
mod clone_gcc;
mod config;
mod info;
mod prepare;
mod rustc_info;
mod test;
mod utils;
const BUILD_DIR: &str = "build";
macro_rules! arg_error {
($($err:tt)*) => {{
eprintln!($($err)*);
@ -22,17 +28,25 @@ fn usage() {
"\
Available commands for build_system:
prepare : Run prepare command
build : Run build command
test : Run test command
--help : Show this message"
cargo : Run cargo command
clean : Run clean command
prepare : Run prepare command
build : Run build command
test : Run test command
info : Run info command
clone-gcc : Run clone-gcc command
--help : Show this message"
);
}
pub enum Command {
Cargo,
Clean,
CloneGcc,
Prepare,
Build,
Test,
Info,
}
fn main() {
@ -41,9 +55,13 @@ fn main() {
}
let command = match env::args().nth(1).as_deref() {
Some("cargo") => Command::Cargo,
Some("clean") => Command::Clean,
Some("prepare") => Command::Prepare,
Some("build") => Command::Build,
Some("test") => Command::Test,
Some("info") => Command::Info,
Some("clone-gcc") => Command::CloneGcc,
Some("--help") => {
usage();
process::exit(0);
@ -57,11 +75,15 @@ fn main() {
};
if let Err(e) = match command {
Command::Cargo => cargo::run(),
Command::Clean => clean::run(),
Command::Prepare => prepare::run(),
Command::Build => build::run(),
Command::Test => test::run(),
Command::Info => info::run(),
Command::CloneGcc => clone_gcc::run(),
} {
eprintln!("Command failed to run: {e:?}");
eprintln!("Command failed to run: {e}");
process::exit(1);
}
}