aboutsummaryrefslogtreecommitdiff
path: root/patio-to-cranelift/src/main.rs
blob: 77409d1f5fb71d3e42df74dcc0fb7cefcf8fa914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::path::PathBuf;

use clap::Parser;

/// Compile Patio compilation units into object files using Cranelift.
#[derive(clap::Parser, Debug)]
struct Args {
    /// The Patio compilation unit to compile.
    source_paths: Vec<PathBuf>,

    /// The LLVM triple to target.
    #[arg(long)]
    target: String,
}

fn main() {
    let args = Args::parse();

    for source_path in args.source_paths {
        patio_to_cranelift::compile(&source_path, &args.target).unwrap();
    }
}