removed sources_cmd (it may make a return)

This commit is contained in:
Noah Swerhun 2024-03-04 20:51:02 -06:00
parent a5ccce1fb5
commit c044c3deb0

View file

@ -10,7 +10,6 @@ pub struct TargetConfig {
pub linker_flags: Vec<String>,
pub linker_libs: Vec<String>,
pub sources: Vec<String>,
pub sources_cmd: String,
pub is_default: bool,
}
@ -25,7 +24,6 @@ impl TargetConfig {
linker_flags: Vec::new(),
linker_libs: Vec::new(),
sources: Vec::new(),
sources_cmd: String::from(""),
is_default: false,
}
}
@ -118,13 +116,6 @@ impl TargetConfig {
panic!("fatal: {k} invalid type, must be a array of strings.");
}
}
"sources_cmd" => {
if let Value::String(s) = table.get(k).unwrap() {
ret.sources_cmd = s.to_owned();
} else {
panic!("fatal: {k} invalid type, must be a string.");
}
}
"default" => {
if let Value::Boolean(b) = table.get(k).unwrap() {
ret.is_default = *b;
@ -145,11 +136,8 @@ impl TargetConfig {
ret.linker = ret.compiler.clone();
}
if (ret.sources == Vec::<String>::new()) && (ret.sources_cmd == String::from("")) {
panic!("fatal: must specify EITHER sources OR sources_cmd, not both.");
}
if !(ret.sources == Vec::<String>::new()) && !(ret.sources_cmd == String::from("")) {
panic!("fatal: must specify EITHER sources OR sources_cmd");
if ret.sources == Vec::<String>::new() {
panic!("fatal: you MUST specify at least one source");
}
ret