translate ../bin -> ../lib search path for plug-ins for installed execs

This commit is contained in:
Thomas Krijnen
2026-07-30 03:35:21 +02:00
parent 4b14c21963
commit 6d7aa3c48c
+12
View File
@@ -349,6 +349,18 @@ PLUGIN_API std::filesystem::path ifcopenshell::plugin::add_search_paths_or_defau
const auto path = default_search_path();
manager.add_search_path(path);
// Static libraries place their anchor in the executable. For a normal
// Unix install this resolves to $prefix/bin, while shared plug-ins are
// installed in $prefix/lib. Windows installs DLL plug-ins in bin already.
#ifndef _WIN32
if (path.filename() == "bin") {
const auto lib = path.parent_path() / "lib";
if (std::filesystem::exists(lib)) {
manager.add_search_path(lib);
}
}
#endif
// Bundle-aware fallback search paths. The primary search path is
// dirname(libIfcParse) which works for the flat layouts we get on
// Linux ($prefix/lib/) and Windows ($prefix/bin/) — plug-ins live