diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-01-25 12:37:13 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-01-30 11:35:24 +0100 |
commit | 06551d00d31b7c8cdaefd69febfe35e4630ea8c5 (patch) | |
tree | 315e58f8a826d880dfb12f9cff1c9c268a32b65f /src | |
parent | 3b08898fb3446926ac4dc5f1fa530f9c61b7737d (diff) | |
download | justbuild-06551d00d31b7c8cdaefd69febfe35e4630ea8c5.tar.gz |
just-mr rc handling: split rc-file search and rc interpretation
... to allow, in a clean way, add computing the effective rc
by overlaying delegated rc files.
Diffstat (limited to 'src')
-rw-r--r-- | src/other_tools/just_mr/rc.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/other_tools/just_mr/rc.cpp b/src/other_tools/just_mr/rc.cpp index c9b1295a..a7894d53 100644 --- a/src/other_tools/just_mr/rc.cpp +++ b/src/other_tools/just_mr/rc.cpp @@ -127,13 +127,8 @@ namespace { return std::nullopt; } -} // namespace - -/// \brief Read just-mrrc file and set up various configs. Return the path to -/// the repository config file, if any is provided. -[[nodiscard]] auto ReadJustMRRC( - gsl::not_null<CommandLineArguments*> const& clargs) - -> std::optional<std::filesystem::path> { +[[nodiscard]] auto ObtainRCConfig( + gsl::not_null<CommandLineArguments*> const& clargs) -> Configuration { Configuration rc_config{}; auto rc_path = clargs->common.rc_path; // set default if rcpath not given @@ -173,6 +168,17 @@ namespace { } } } + return rc_config; +} + +} // namespace + +/// \brief Read just-mrrc file and set up various configs. Return the path to +/// the repository config file, if any is provided. +[[nodiscard]] auto ReadJustMRRC( + gsl::not_null<CommandLineArguments*> const& clargs) + -> std::optional<std::filesystem::path> { + Configuration rc_config = ObtainRCConfig(clargs); // read local build root; overwritten if user provided it already if (not clargs->common.just_mr_paths->root) { auto build_root = |