//----------------------------------------------------------------------------//
static String getModuleDirEnvVar()
{
if (const char* envModuleDir = getenv(MODULE_DIR_VAR_NAME))
return String(envModuleDir);
return String();
}
//----------------------------------------------------------------------------// static DYNLIB_HANDLE DynLibLoad(const String& name) { DYNLIB_HANDLE handle = 0; // prefer whatever location is set in CEGUI_MODULE_DIR environment var const String envModuleDir(getModuleDirEnvVar()); if (!envModuleDir.empty()) handle = DYNLIB_LOAD(envModuleDir + '/' + name); #ifdef __APPLE__ if (!handle) // on apple, look in the app bundle frameworks directory handle = DYNLIB_LOAD("@executable_path/../Frameworks/" + name); #endif if (!handle) // try loading without any explicit location (i.e. use OS search path) handle = DYNLIB_LOAD(name); // finally, try using the compiled-in module directory #if defined(CEGUI_MODULE_DIR) if (!handle) handle = DYNLIB_LOAD(CEGUI_MODULE_DIR + name); #endif return handle; }
标签:envModuleDir,调用,handle,String,DYNLIB,动态链接库,cegui,DIR,name From: https://www.cnblogs.com/zxdplay/p/16855414.html