Skip to content
Snippets Groups Projects
Commit 2f562397 authored by Mark Winter's avatar Mark Winter
Browse files

Output to user if config is in conflict with compilation

parent 63d674fa
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,9 @@
#include <string>
#include <algorithm>
#include "ScopedProcessMutex.h"
#include "ScriptIncludes.h"
class HydraConfig
{
public:
......@@ -48,11 +51,20 @@ private:
}
}
// TODO: MRW HACK - this is a pretty nasty way to get config info to user
static void checkConfig(HydraConfig* pInst)
{
if ( pInst->bUseProcessMutex && !SUPPORT_PROCESS_MUTEX() )
Script::warnMsg("HYDRA_ENABLE_MUTEX set to TRUE but Hydra was compiled without USE_PROCESS_MUTEX flag!\n");
}
static HydraConfig* initConfig()
{
HydraConfig* pInst = new HydraConfig();
HydraConfig::loadConfig(pInst);
HydraConfig::checkConfig(pInst);
return pInst;
}
......
#pragma once
#ifdef USE_PROCESS_MUTEX
#define SUPPORT_PROCESS_MUTEX() (1)
#define SCOPED_PROCESS_MUTEX(Name) ScopedProcessMutex Name##_mutex(#Name)
#else
#define SUPPORT_PROCESS_MUTEX() (0)
#define SCOPED_PROCESS_MUTEX(Name)
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment