llvm_profparser 0.7.0

Parsing and interpretation of llvm coverage profiles and generated data
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::{env, process::Command};

fn main() {
    let rustc = env::var("RUSTC").unwrap();

    let output = Command::new(rustc).arg("-vV").output().unwrap();

    let version_info = String::from_utf8_lossy(&output.stdout);

    if let Some(major) = version_info
        .lines()
        .find_map(|x| x.strip_prefix("LLVM version: "))
        .and_then(|x| x.split('.').next())
    {
        println!("cargo:rustc-cfg=llvm_{}", major);
    }
}