Skip to content

Commit f95edbe

Browse files
committed
move gcc config parsing to parse_inner
1 parent 924a5a4 commit f95edbe

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,15 @@ impl Config {
979979

980980
config.apply_llvm_config(toml.llvm);
981981

982-
config.apply_gcc_config(toml.gcc);
982+
if let Some(gcc) = toml.gcc {
983+
config.gcc_ci_mode = match gcc.download_ci_gcc {
984+
Some(value) => match value {
985+
true => GccCiMode::DownloadFromCi,
986+
false => GccCiMode::BuildLocally,
987+
},
988+
None => GccCiMode::default(),
989+
};
990+
}
983991

984992
match ccache {
985993
Some(StringOrBool::String(ref s)) => config.ccache = Some(s.to_string()),

src/bootstrap/src/core/config/toml/gcc.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,13 @@
66
77
use serde::{Deserialize, Deserializer};
88

9+
use crate::core::config::Merge;
910
use crate::core::config::toml::ReplaceOpt;
10-
use crate::core::config::{GccCiMode, Merge};
11-
use crate::{Config, HashSet, PathBuf, define_config, exit};
11+
use crate::{HashSet, PathBuf, define_config, exit};
1212

1313
define_config! {
1414
/// TOML representation of how the GCC build is configured.
1515
struct Gcc {
1616
download_ci_gcc: Option<bool> = "download-ci-gcc",
1717
}
1818
}
19-
20-
impl Config {
21-
/// Applies GCC-related configuration from the `TomlGcc` struct to the
22-
/// global `Config` structure.
23-
pub fn apply_gcc_config(&mut self, toml_gcc: Option<Gcc>) {
24-
if let Some(gcc) = toml_gcc {
25-
self.gcc_ci_mode = match gcc.download_ci_gcc {
26-
Some(value) => match value {
27-
true => GccCiMode::DownloadFromCi,
28-
false => GccCiMode::BuildLocally,
29-
},
30-
None => GccCiMode::default(),
31-
};
32-
}
33-
}
34-
}

0 commit comments

Comments
 (0)