llama-cpp-bindings-build 0.31.0

Build scripts of llama-cpp-native, which builds llama.cpp with CMake, and llama-cpp-bindings-sys, which generates the bindings and compiles the C++ wrapper
use std::ffi::OsString;

#[derive(Clone, Debug, Eq, PartialEq)]
pub struct CmakeDefine {
    pub name: &'static str,
    pub value: OsString,
}

impl CmakeDefine {
    #[must_use]
    pub fn new(name: &'static str, value: impl Into<OsString>) -> Self {
        Self {
            name,
            value: value.into(),
        }
    }

    #[must_use]
    pub fn switch(name: &'static str, enabled: bool) -> Self {
        Self::new(name, if enabled { "ON" } else { "OFF" })
    }
}