summaryrefslogtreecommitdiff
path: root/src/buildtool/main/serve.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-12-05 17:29:30 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-12-06 11:57:16 +0100
commit8739f2bb6e07321c4e92e5610f92785cae950ff7 (patch)
tree95e633e16ff45b2a76769c8608d5652d67bb83c4 /src/buildtool/main/serve.cpp
parentef2da9cbe1d55fd9667ad7fe42792ffd8ed0ec50 (diff)
downloadjustbuild-8739f2bb6e07321c4e92e5610f92785cae950ff7.tar.gz
just serve: make tc write strategy configurable
Diffstat (limited to 'src/buildtool/main/serve.cpp')
-rw-r--r--src/buildtool/main/serve.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/buildtool/main/serve.cpp b/src/buildtool/main/serve.cpp
index 1c079032..32da7801 100644
--- a/src/buildtool/main/serve.cpp
+++ b/src/buildtool/main/serve.cpp
@@ -399,6 +399,27 @@ void ReadJustServeConfig(gsl::not_null<CommandLineArguments*> const& clargs) {
clargs->build.timeout =
std::size_t(timeout->Number()) * std::chrono::seconds{1};
}
+ auto strategy = build_args->Get("target-cache write strategy",
+ Expression::none_t{});
+ if (strategy.IsNotNull()) {
+ if (not strategy->IsString()) {
+ Logger::Log(
+ LogLevel::Error,
+ "just serve: configuration-file provided target-cache "
+ "write strategy has to be a string, but found {}",
+ strategy->ToString());
+ std::exit(kExitFailure);
+ }
+ auto s_value = ToTargetCacheWriteStrategy(strategy->String());
+ if (not s_value) {
+ Logger::Log(LogLevel::Error,
+ "just serve: configuration-file provided unknown "
+ "target-cache write strategy {}",
+ strategy->ToString());
+ std::exit(kExitFailure);
+ }
+ clargs->tc.target_cache_write_strategy = *s_value;
+ }
}
}