mirror of https://github.com/KLayout/klayout.git
Bugfix: also recognize plugins when the main binary is installed in a different place than the libs.
This commit is contained in:
parent
98ecc9e47b
commit
ddfb084a8d
|
|
@ -98,12 +98,12 @@ static PluginDescriptor load_plugin (const std::string &pp)
|
||||||
void init (const std::vector<std::string> &_paths)
|
void init (const std::vector<std::string> &_paths)
|
||||||
{
|
{
|
||||||
std::vector<std::string> paths = _paths;
|
std::vector<std::string> paths = _paths;
|
||||||
if (paths.empty ()) {
|
|
||||||
|
// add the module path so we also look beside the "db" library
|
||||||
std::string module_path = tl::get_module_path ((void *) &init);
|
std::string module_path = tl::get_module_path ((void *) &init);
|
||||||
if (! module_path.empty ()) {
|
if (! module_path.empty ()) {
|
||||||
paths.push_back (tl::absolute_path (module_path));
|
paths.push_back (tl::absolute_path (module_path));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (paths.empty ()) {
|
if (paths.empty ()) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
|
|
@ -119,7 +119,9 @@ void init (const std::vector<std::string> &_paths)
|
||||||
const char *db_plugin_dir = "db_plugins";
|
const char *db_plugin_dir = "db_plugins";
|
||||||
std::string pp = tl::combine_path (*p, db_plugin_dir);
|
std::string pp = tl::combine_path (*p, db_plugin_dir);
|
||||||
|
|
||||||
tl::log << tl::sprintf (tl::to_string (tr ("Scanning '%s' for plugins ..")), pp);
|
if (tl::verbosity () >= 20) {
|
||||||
|
tl::info << "Scanning for db plugins: " << pp;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> ee = tl::dir_entries (pp, true, false);
|
std::vector<std::string> ee = tl::dir_entries (pp, true, false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,6 @@ tl::XMLElementList load_options_xml_element_list ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore all unknown elements
|
|
||||||
elements.append (tl::make_member<db::LoadLayoutOptions> ("*"));
|
|
||||||
|
|
||||||
return elements;
|
return elements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,9 +65,6 @@ tl::XMLElementList save_options_xml_element_list ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore all unknown elements
|
|
||||||
elements.append (tl::make_member<db::FormatSpecificWriterOptions> ("*"));
|
|
||||||
|
|
||||||
return elements;
|
return elements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,11 +99,11 @@ void load_plugin (const std::string &pp)
|
||||||
void init (const std::vector<std::string> &_paths)
|
void init (const std::vector<std::string> &_paths)
|
||||||
{
|
{
|
||||||
std::vector<std::string> paths = _paths;
|
std::vector<std::string> paths = _paths;
|
||||||
if (paths.empty ()) {
|
|
||||||
|
// add the module path so we also look beside the "db" library
|
||||||
std::string module_path = tl::get_module_path ((void *) &init);
|
std::string module_path = tl::get_module_path ((void *) &init);
|
||||||
if (! module_path.empty ()) {
|
if (! module_path.empty ()) {
|
||||||
paths.push_back (module_path);
|
paths.push_back (tl::absolute_path (module_path));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paths.empty ()) {
|
if (paths.empty ()) {
|
||||||
|
|
@ -120,7 +120,9 @@ void init (const std::vector<std::string> &_paths)
|
||||||
const char *lay_plugin_dir = "lay_plugins";
|
const char *lay_plugin_dir = "lay_plugins";
|
||||||
std::string pp = tl::combine_path (*p, lay_plugin_dir);
|
std::string pp = tl::combine_path (*p, lay_plugin_dir);
|
||||||
|
|
||||||
tl::log << tl::sprintf (tl::to_string (tr ("Scanning '%s' for plugins ..")), pp);
|
if (tl::verbosity () >= 20) {
|
||||||
|
tl::info << "Scanning for lay plugins: " << pp;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> ee = tl::dir_entries (pp, true, false);
|
std::vector<std::string> ee = tl::dir_entries (pp, true, false);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue