summaryrefslogtreecommitdiff
path: root/src/buildtool/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r--src/buildtool/main/main.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index 0063e9bd..bdd1bed5 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -867,11 +867,7 @@ auto main(int argc, char* argv[]) -> int {
if (arguments.cmd == SubCommand::kServe) {
SetupServeServiceConfig(arguments.service);
- std::optional<gsl::not_null<const ServeApi*>> serve;
- if (RemoteServeConfig::Instance().RemoteAddress()) {
- serve = &ServeApi::Instance();
- }
-
+ auto serve = ServeApi::Create(RemoteServeConfig::Instance());
if (!ServeServerImpl::Instance().Run(
RemoteServeConfig::Instance(),
serve,
@@ -956,12 +952,10 @@ auto main(int argc, char* argv[]) -> int {
DetermineRoots(&repo_config, arguments.common, arguments.analysis);
#ifndef BOOTSTRAP_BUILD_TOOL
- std::optional<gsl::not_null<const ServeApi*>> serve;
- if (RemoteServeConfig::Instance().RemoteAddress()) {
- serve = &ServeApi::Instance();
- }
+ std::optional<ServeApi> serve =
+ ServeApi::Create(RemoteServeConfig::Instance());
#else
- std::optional<gsl::not_null<const ServeApi*>> serve;
+ std::optional<ServeApi> serve;
#endif // BOOTSTRAP_BUILD_TOOL
#ifndef BOOTSTRAP_BUILD_TOOL