summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/build_system/src/info.rs
blob: ea38791d38c9a64c9571720242532d4c81d63961 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::config::ConfigInfo;

pub fn run() -> Result<(), String> {
    let mut config = ConfigInfo::default();

    // We skip binary name and the `info` command.
    let mut args = std::env::args().skip(2);
    while let Some(arg) = args.next() {
        if arg == "--help" {
            println!("Display the path where the libgccjit will be located");
            return Ok(());
        }
        config.parse_argument(&arg, &mut args)?;
    }
    config.no_download = true;
    config.setup_gcc_path()?;
    println!("{}", config.gcc_path);
    Ok(())
}