mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 16:49:37 +00:00
Custom output directory via build.target
This commit is contained in:
@@ -216,16 +216,19 @@ fn format_toml(value: &Value) -> Result<String, ConfigError> {
|
||||
out.push_str("[build]\n");
|
||||
out.push_str(&format!("language = \"{language}\"\n"));
|
||||
out.push_str(&format!("standard = \"{standard}\"\n"));
|
||||
out.push_str(&format!("compiler = \"{compiler}\"\n\n"));
|
||||
out.push_str(&format!("compiler = \"{compiler}\"\n"));
|
||||
if let Some(target) = build.get("target").and_then(|v| v.as_str()) {
|
||||
if !target.trim().is_empty() {
|
||||
out.push_str(&format!("target = \"{target}\"\n"));
|
||||
}
|
||||
}
|
||||
if let Some(cflags) = build.get("cflags") {
|
||||
out.push_str(&format!("cflags = {}\n", format_string_array(cflags)));
|
||||
}
|
||||
if let Some(ldflags) = build.get("ldflags") {
|
||||
out.push_str(&format!("ldflags = {}\n", format_string_array(ldflags)));
|
||||
}
|
||||
if build.contains_key("cflags") || build.contains_key("ldflags") {
|
||||
out.push('\n');
|
||||
}
|
||||
out.push('\n');
|
||||
|
||||
out.push_str("[dependencies]\n");
|
||||
if !deps.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user