mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
vcmi can be compiled as single app on Linux
TODO: check compilation on Win/Mac using Github Actions
This commit is contained in:
@@ -4,4 +4,6 @@
|
|||||||
|
|
||||||
// This header should be treated as a pre compiled header file(PCH) in the compiler building settings.
|
// This header should be treated as a pre compiled header file(PCH) in the compiler building settings.
|
||||||
|
|
||||||
// Here you can add specific libraries and macros which are specific to this project.
|
// Here you can add specific libraries and macros which are specific to this project.
|
||||||
|
|
||||||
|
VCMI_LIB_USING_NAMESPACE
|
||||||
|
|||||||
@@ -25,12 +25,15 @@
|
|||||||
#include "../lib/CAndroidVMHelper.h"
|
#include "../lib/CAndroidVMHelper.h"
|
||||||
#elif defined(VCMI_IOS)
|
#elif defined(VCMI_IOS)
|
||||||
#include "ios/utils.h"
|
#include "ios/utils.h"
|
||||||
#include "../server/CVCMIServer.h"
|
|
||||||
|
|
||||||
#include <dispatch/dispatch.h>
|
#include <dispatch/dispatch.h>
|
||||||
#else
|
#else
|
||||||
#include "../lib/Interprocess.h"
|
#include "../lib/Interprocess.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SINGLE_PROCESS_APP
|
||||||
|
#include "../server/CVCMIServer.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../lib/CConfigHandler.h"
|
#include "../lib/CConfigHandler.h"
|
||||||
#include "../lib/CGeneralTextHandler.h"
|
#include "../lib/CGeneralTextHandler.h"
|
||||||
#include "../lib/CThreadHelper.h"
|
#include "../lib/CThreadHelper.h"
|
||||||
@@ -142,7 +145,7 @@ void CServerHandler::resetStateForLobby(const StartInfo::EMode mode, const std::
|
|||||||
else
|
else
|
||||||
myNames.push_back(settings["general"]["playerName"].String());
|
myNames.push_back(settings["general"]["playerName"].String());
|
||||||
|
|
||||||
#if !defined(VCMI_ANDROID) && !defined(VCMI_IOS)
|
#if !defined(VCMI_ANDROID) && !defined(SINGLE_PROCESS_APP)
|
||||||
shm.reset();
|
shm.reset();
|
||||||
|
|
||||||
if(!settings["session"]["disable-shm"].Bool())
|
if(!settings["session"]["disable-shm"].Bool())
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ class IVCMIDirsUNIX : public IVCMIDirs
|
|||||||
bool IVCMIDirsUNIX::developmentMode() const
|
bool IVCMIDirsUNIX::developmentMode() const
|
||||||
{
|
{
|
||||||
// We want to be able to run VCMI from single directory. E.g to run from build output directory
|
// We want to be able to run VCMI from single directory. E.g to run from build output directory
|
||||||
return bfs::exists("AI") && bfs::exists("config") && bfs::exists("Mods") && bfs::exists("vcmiserver") && bfs::exists("vcmiclient");
|
return bfs::exists("AI") && bfs::exists("config") && bfs::exists("Mods") && bfs::exists("../CMakeCache.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
bfs::path IVCMIDirsUNIX::clientPath() const { return binaryPath() / "vcmiclient"; }
|
bfs::path IVCMIDirsUNIX::clientPath() const { return binaryPath() / "vcmiclient"; }
|
||||||
|
|||||||
@@ -1043,7 +1043,7 @@ static void handleCommandOptions(int argc, char * argv[], boost::program_options
|
|||||||
#endif
|
#endif
|
||||||
int main(int argc, char * argv[])
|
int main(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
#if !defined(VCMI_ANDROID) && !defined(VCMI_IOS)
|
#if !defined(VCMI_ANDROID) && !defined(SINGLE_PROCESS_APP)
|
||||||
// Correct working dir executable folder (not bundle folder) so we can use executable relative paths
|
// Correct working dir executable folder (not bundle folder) so we can use executable relative paths
|
||||||
boost::filesystem::current_path(boost::filesystem::system_complete(argv[0]).parent_path());
|
boost::filesystem::current_path(boost::filesystem::system_complete(argv[0]).parent_path());
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user