diff --git a/client/ServerRunner.cpp b/client/ServerRunner.cpp index 2a7a0791e..2979a757f 100644 --- a/client/ServerRunner.cpp +++ b/client/ServerRunner.cpp @@ -15,11 +15,19 @@ #include "../lib/CThreadHelper.h" #include "../server/CVCMIServer.h" -#ifndef VCMI_MOBILE +#ifdef ENABLE_SERVER_PROCESS + +#if BOOST_VERSION >= 108600 +// TODO: upgrade code to use v2 API instead of deprecated v1 +#include +#include +#else #include #include #endif +#endif + #include ServerThreadRunner::ServerThreadRunner() = default; @@ -66,7 +74,7 @@ int ServerThreadRunner::exitCode() return 0; } -#ifndef VCMI_MOBILE +#ifdef ENABLE_SERVER_PROCESS ServerProcessRunner::ServerProcessRunner() = default; ServerProcessRunner::~ServerProcessRunner() = default; diff --git a/client/ServerRunner.h b/client/ServerRunner.h index d5ba38b53..313a61a03 100644 --- a/client/ServerRunner.h +++ b/client/ServerRunner.h @@ -44,10 +44,23 @@ public: }; #ifndef VCMI_MOBILE +// Enable support for running vcmiserver as separate process. Unavailable on mobile systems +#define ENABLE_SERVER_PROCESS +#endif +#ifdef ENABLE_SERVER_PROCESS + +#if BOOST_VERSION >= 108600 +namespace boost::process { +inline namespace v1 { +class child; +} +} +#else namespace boost::process { class child; } +#endif /// Class that runs server instance as a child process /// Available only on desktop systems where process management is allowed