ngen/src/deser.rs

45 lines
1.2 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 DeserTarget {
2024-03-12 01:22:08 +00:00
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<DeserTargetOptions>,
2024-03-12 01:22:08 +00:00
}
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct DeserTargetOptions {
2024-03-12 01:22:08 +00:00
pub inherit: Option<bool>,
pub inherit_from: Option<String>,
pub depend_on: Option<Vec<String>>,
2024-03-12 01:22:08 +00:00
pub default: Option<bool>,
2024-03-15 14:27:43 +00:00
pub compile_cmd_fmt: Option<String>,
pub link_cmd_fmt: Option<String>,
2024-04-03 22:17:50 +00:00
pub object_suffix: Option<String>,
2024-03-12 01:22:08 +00:00
}
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct DeserConfig {
2024-03-12 01:22:08 +00:00
pub build_dir: Option<String>,
pub compile_commands: Option<bool>,
pub compile_commands_target: Option<String>,
}
pub type DeserTargetList = HashMap<String, DeserTarget>;
2024-03-12 01:22:08 +00:00
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct DeserNgenToml {
pub config: Option<DeserConfig>,
pub targets: Option<DeserTargetList>,
2024-03-12 01:22:08 +00:00
}