mirror of
https://gitlab.com/eql/EQL5.git
synced 2026-03-15 11:10:34 -07:00
fix module loading in deployed apps (next attempt; not tested yet on all platforms)
This commit is contained in:
parent
8ffe0bc0a4
commit
f90cbbaf24
1 changed files with 7 additions and 10 deletions
|
|
@ -2433,20 +2433,17 @@ cl_object qrequire2(cl_object l_name, cl_object l_quiet) { /// qrequire
|
|||
/// (qrequire :network)
|
||||
ecl_process_env()->nvalues = 1;
|
||||
QString name = symbolName(l_name);
|
||||
QString fileName = "eql5_" + name;
|
||||
QLibrary lib(fileName);
|
||||
QStringList libPaths = QCoreApplication::libraryPaths();
|
||||
QString file("eql5_" + name);
|
||||
QString path("/usr/local/lib/"); // 'local' might not be in library search paths
|
||||
#ifdef Q_OS_MACOS
|
||||
// try bundle first
|
||||
QString appPath(QCoreApplication::applicationDirPath());
|
||||
if(appPath.contains(".app/") {
|
||||
libPaths.prepend(appPath + "/../libs")); }
|
||||
else {
|
||||
libPaths.prepend("/usr/local/lib"); }
|
||||
#else
|
||||
libPaths.prepend("/usr/local/lib");
|
||||
if(appPath.contains(".app/")) {
|
||||
path = appPath + "/../libs/"; }
|
||||
#endif
|
||||
QCoreApplication::setLibraryPaths(libPaths);
|
||||
QLibrary lib(path + file);
|
||||
if(!lib.load()) {
|
||||
lib.setFileName(file); } // use default library paths
|
||||
typedef void (*Ini)();
|
||||
Ini ini = (Ini)lib.resolve("ini");
|
||||
if(ini) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue