From 6d7aa3c48c17fd08ca6cffeb8df475bbbfef29ae Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 30 Jul 2026 03:35:21 +0200 Subject: [PATCH] translate ../bin -> ../lib search path for plug-ins for installed execs --- src/plugin/plugin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugin/plugin.cpp b/src/plugin/plugin.cpp index 9a967fa4b8..52941dd9e1 100644 --- a/src/plugin/plugin.cpp +++ b/src/plugin/plugin.cpp @@ -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