aboutsummaryrefslogtreecommitdiff
path: root/zenserver
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver')
-rw-r--r--zenserver/compute/apply.cpp4
-rw-r--r--zenserver/compute/apply.h8
-rw-r--r--zenserver/testing/launch.cpp4
-rw-r--r--zenserver/testing/launch.h8
-rw-r--r--zenserver/zenserver.cpp8
5 files changed, 31 insertions, 1 deletions
diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp
index 6669108d2..e1ab7c984 100644
--- a/zenserver/compute/apply.cpp
+++ b/zenserver/compute/apply.cpp
@@ -2,6 +2,8 @@
#include "apply.h"
+#if ZEN_WITH_COMPUTE_SERVICES
+
#include <zencore/compactbinary.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/compactbinarypackage.h>
@@ -873,3 +875,5 @@ HttpFunctionService::ExecAction(const WorkerDesc& Worker, CbObject Action)
}
} // namespace zen
+
+#endif // ZEN_WITH_COMPUTE_SERVICES
diff --git a/zenserver/compute/apply.h b/zenserver/compute/apply.h
index 86b262213..2c144adad 100644
--- a/zenserver/compute/apply.h
+++ b/zenserver/compute/apply.h
@@ -2,6 +2,12 @@
#pragma once
+#if !defined(ZEN_WITH_COMPUTE_SERVICES)
+# define ZEN_WITH_COMPUTE_SERVICES ZEN_PLATFORM_WINDOWS
+#endif
+
+#if ZEN_WITH_COMPUTE_SERVICES
+
#include <zencore/compactbinary.h>
#include <zencore/iohash.h>
#include <zencore/logging.h>
@@ -50,3 +56,5 @@ private:
};
} // namespace zen
+
+#endif // ZEN_WITH_COMPUTE_SERVICES
diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp
index 569bf99e0..8e58b481e 100644
--- a/zenserver/testing/launch.cpp
+++ b/zenserver/testing/launch.cpp
@@ -2,6 +2,8 @@
#include "launch.h"
+#if ZEN_WITH_COMPUTE_SERVICES
+
#include <zencore/compactbinary.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/filesystem.h>
@@ -563,3 +565,5 @@ HttpLaunchService::CreateNewSandbox()
}
} // namespace zen
+
+#endif // ZEN_WITH_COMPUTE_SERVICES
diff --git a/zenserver/testing/launch.h b/zenserver/testing/launch.h
index 49f12e2ec..864d6ac5d 100644
--- a/zenserver/testing/launch.h
+++ b/zenserver/testing/launch.h
@@ -2,6 +2,12 @@
#pragma once
+#if !defined(ZEN_WITH_COMPUTE_SERVICES)
+# define ZEN_WITH_COMPUTE_SERVICES ZEN_PLATFORM_WINDOWS
+#endif
+
+#if ZEN_WITH_COMPUTE_SERVICES
+
#include <zencore/logging.h>
#include <zenhttp/httpserver.h>
@@ -36,3 +42,5 @@ private:
};
} // namespace zen
+
+#endif // ZEN_WITH_COMPUTE_SERVICES
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 37b841a3f..06f3911ec 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -222,6 +222,7 @@ public:
m_HttpProjectService.reset(new zen::HttpProjectService{*m_CidStore, m_ProjectStore});
m_LocalProjectService = zen::LocalProjectService::New(*m_CasStore, m_ProjectStore);
+#if ZEN_WITH_COMPUTE_SERVICES
ZEN_INFO("instantiating compute services");
std::filesystem::path SandboxDir = m_DataRoot / "exec" / "sandbox";
@@ -231,6 +232,7 @@ public:
std::filesystem::path ApplySandboxDir = m_DataRoot / "exec" / "apply";
zen::CreateDirectories(ApplySandboxDir);
m_HttpFunctionService = std::make_unique<zen::HttpFunctionService>(*m_CasStore, *m_CidStore, ApplySandboxDir);
+#endif // ZEN_WITH_COMPUTE_SERVICES
if (ServiceConfig.StructuredCacheEnabled)
{
@@ -268,6 +270,7 @@ public:
m_Http->RegisterService(*m_StructuredCacheService);
}
+#if ZEN_WITH_COMPUTE_SERVICES
if (m_HttpLaunchService)
{
m_Http->RegisterService(*m_HttpLaunchService);
@@ -277,6 +280,7 @@ public:
{
m_Http->RegisterService(*m_HttpFunctionService);
}
+#endif // ZEN_WITH_COMPUTE_SERVICES
m_FrontendService = std::make_unique<HttpFrontendService>(m_ContentRoot);
@@ -506,13 +510,15 @@ private:
zen::HttpCasService m_CasService{*m_CasStore};
zen::RefPtr<zen::ProjectStore> m_ProjectStore;
zen::Ref<zen::LocalProjectService> m_LocalProjectService;
- std::unique_ptr<zen::HttpLaunchService> m_HttpLaunchService;
std::unique_ptr<zen::HttpProjectService> m_HttpProjectService;
std::unique_ptr<zen::HttpStructuredCacheService> m_StructuredCacheService;
zen::HttpAdminService m_AdminService;
zen::HttpHealthService m_HealthService;
zen::Mesh m_ZenMesh{m_IoContext};
+#if ZEN_WITH_COMPUTE_SERVICES
+ std::unique_ptr<zen::HttpLaunchService> m_HttpLaunchService;
std::unique_ptr<zen::HttpFunctionService> m_HttpFunctionService;
+#endif
std::unique_ptr<zen::HttpFrontendService> m_FrontendService;
bool m_DebugOptionForcedCrash = false;