machine-check-compile 0.7.1

Utility crate for the formal verification tool machine-check
Documentation
use std::process::Command;

fn features() -> Vec<&'static str> {
    // add features
    let mut features = Vec::new();
    if cfg!(feature = "gui") {
        features.push("gui");
    }
    if cfg!(feature = "Zdual_interval") {
        features.push("Zdual_interval");
    }
    if cfg!(feature = "Zeq_domain") {
        features.push("Zeq_domain");
    }
    features
}

pub(super) fn add_rustc_features(build_command: &mut Command) {
    for feature in features() {
        build_command
            .arg("--cfg")
            .arg(format!("feature=\"{}\"", feature));
    }
}

pub(super) fn add_cargo_features(build_command: &mut Command) {
    let features = features();
    if !features.is_empty() {
        let features = features.join(",");
        build_command.arg("--features").arg(features);
    }
}