Compile out module path search code when module support is disabled
This commit is contained in:
parent
84f9c44ab6
commit
72cb9bd940
@ -243,7 +243,7 @@ namespace chaiscript
|
||||
m_parser(std::move(parser)),
|
||||
m_engine(*m_parser)
|
||||
{
|
||||
#if defined(_POSIX_VERSION) && !defined(__CYGWIN__)
|
||||
#if !defined(CHAISCRIPT_NO_DYNLOAD) && defined(_POSIX_VERSION) && !defined(__CYGWIN__)
|
||||
// If on Unix, add the path of the current executable to the module search path
|
||||
// as windows would do
|
||||
|
||||
|
@ -68,6 +68,7 @@ std::vector<std::string> default_search_paths()
|
||||
{
|
||||
std::vector<std::string> paths;
|
||||
|
||||
#ifndef CHAISCRIPT_NO_DYNLOAD
|
||||
#ifdef CHAISCRIPT_WINDOWS // force no unicode
|
||||
CHAR path[4096];
|
||||
int size = GetModuleFileNameA(0, path, sizeof(path) - 1);
|
||||
@ -137,6 +138,7 @@ std::vector<std::string> default_search_paths()
|
||||
paths.push_back(exepath.substr(0, secondtolastslash) + "/lib/chaiscript/");
|
||||
}
|
||||
#endif
|
||||
#endif // ifndef CHAISCRIPT_NO_DYNLOAD
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ std::vector<std::string> default_search_paths()
|
||||
{
|
||||
std::vector<std::string> paths;
|
||||
|
||||
#ifndef CHAISCRIPT_NO_DYNLOAD
|
||||
#ifdef CHAISCRIPT_WINDOWS // force no unicode
|
||||
CHAR path[4096];
|
||||
int size = GetModuleFileNameA(nullptr, path, sizeof(path)-1);
|
||||
@ -140,6 +141,7 @@ std::vector<std::string> default_search_paths()
|
||||
paths.push_back(exepath.substr(0, secondtolastslash) + "/lib/chaiscript/");
|
||||
}
|
||||
#endif
|
||||
#endif // ifndef CHAISCRIPT_NO_DYNLOAD
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user