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

Output to user if config is in conflict with compilation

parent 9dd6201d
Branches
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
#pragma message ("HIP (leverjs) :: no process mutex in use")
#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