diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-11-24 11:31:42 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-11-27 15:03:20 +0100 |
commit | cf04253130030bc28866d10aa1f8fe1353643d42 (patch) | |
tree | ef7049624771866455105a8dab7b001840139701 /src/buildtool/build_engine/target_map/utils.cpp | |
parent | bc09302c2772c979c45ecc716c36e4a70bb484ac (diff) | |
download | justbuild-cf04253130030bc28866d10aa1f8fe1353643d42.tar.gz |
Refactoring RepositoryConfig
With the introduction of 'just serve', export targets can now be
built also independently from one another based on their
corresponding minimal repository configuration, as stored in the
target cache key.
In this context, this commit changes the RepositoryConfig usage
from one global (static) instance to pointers passed as necessary
throughout the code.
Diffstat (limited to 'src/buildtool/build_engine/target_map/utils.cpp')
-rw-r--r-- | src/buildtool/build_engine/target_map/utils.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/buildtool/build_engine/target_map/utils.cpp b/src/buildtool/build_engine/target_map/utils.cpp index 55543e30..aa733521 100644 --- a/src/buildtool/build_engine/target_map/utils.cpp +++ b/src/buildtool/build_engine/target_map/utils.cpp @@ -27,6 +27,7 @@ auto BuildMaps::Target::Utils::obtainTargetByName( const ExpressionPtr& expr, const Configuration& env, const Base::EntityName& current, + const gsl::not_null<RepositoryConfig*>& repo_config, std::unordered_map<BuildMaps::Target::ConfiguredTarget, AnalysedTargetPtr> const& deps_by_transition) -> AnalysedTargetPtr { @@ -34,9 +35,10 @@ auto BuildMaps::Target::Utils::obtainTargetByName( auto reference = eval(expr["dep"], env); std::string error{}; auto target = BuildMaps::Base::ParseEntityNameFromExpression( - reference, current, [&error](std::string const& parse_err) { - error = parse_err; - }); + reference, + current, + repo_config, + [&error](std::string const& parse_err) { error = parse_err; }); if (not target) { throw Evaluator::EvaluationError{ fmt::format("Parsing target name {} failed with:\n{}", |