summaryrefslogtreecommitdiff
path: root/src/buildtool/main/main.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-03-02 10:15:53 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-03-02 12:05:58 +0100
commit2037d87d34c2a94b48b148b4151c1343169a5568 (patch)
tree069796685b7d7a5ef9467dffe0e4b423e47ce1a4 /src/buildtool/main/main.cpp
parentfa0ec67e09959ff15363bab8d6be95fe45ec8fb6 (diff)
downloadjustbuild-2037d87d34c2a94b48b148b4151c1343169a5568.tar.gz
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.
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r--src/buildtool/main/main.cpp13
1 files changed, 6 insertions, 7 deletions
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);
}