ngen/src/ngen_toml.rs

39 lines
1.1 KiB
Rust
Raw Normal View History

2024-03-12 01:22:08 +00:00
use serde::Deserialize;
use std::collections::HashMap;
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ParsedTarget {
pub outfile: Option<String>,
pub compiler: Option<String>,
pub compiler_flags: Option<Vec<String>>,
pub linker: Option<String>,
pub linker_flags: Option<Vec<String>>,
pub linker_libs: Option<Vec<String>>,
pub sources: Option<Vec<String>>,
pub opts: Option<ParsedTargetOptions>,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ParsedTargetOptions {
pub inherit: Option<bool>,
pub inherit_from: Option<String>,
pub default: Option<bool>,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ParsedConfigTable {
pub build_dir: Option<String>,
pub compile_commands: Option<bool>,
pub compile_commands_target: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct NgenToml {
pub config: Option<ParsedConfigTable>,
pub targets: Option<HashMap<String, ParsedTarget>>,
}