From 2037d87d34c2a94b48b148b4151c1343169a5568 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 2 Mar 2023 10:15:53 +0100 Subject: just: make -D options overlay ... instead of only honoring the latest argument. In this way, standard overlays coming from the launcher configuration can be amended in individual invocations. --- src/buildtool/main/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/buildtool/main/main.cpp') diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 98812abd..869ed146 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -487,21 +487,20 @@ void SetupHashFunction() { } } - if (not clargs.defines.empty()) { + for (auto const& s : clargs.defines) { try { - auto map = - Expression::FromJson(nlohmann::json::parse(clargs.defines)); + auto map = Expression::FromJson(nlohmann::json::parse(s)); if (not map->IsMap()) { Logger::Log(LogLevel::Error, - "Defines {} does not contain a map.", - clargs.defines); + "Defines entry {} does not contain a map.", + nlohmann::json(s).dump()); std::exit(kExitFailure); } config = config.Update(map); } catch (std::exception const& e) { Logger::Log(LogLevel::Error, - "Parsing defines {} failed with error:\n{}", - clargs.defines, + "Parsing defines entry {} failed with error:\n{}", + nlohmann::json(s).dump(), e.what()); std::exit(kExitFailure); } -- cgit v1.2.3