mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
Fixes to plug-in loading in and outside of pyodide
This commit is contained in:
@@ -24,6 +24,12 @@
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
|
||||
namespace ifcopenshell {
|
||||
namespace plugin {
|
||||
PLUGIN_API std::filesystem::path add_search_paths_or_default(manager& manager, std::filesystem::path (*default_search_path)());
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
std::string geometry_serializer_plugin_prefix(const std::string& format = std::string()) {
|
||||
@@ -52,8 +58,11 @@ std::string geometry_serializer_format_from_extension(const std::string& extensi
|
||||
}
|
||||
|
||||
void add_geometry_serializer_search_paths(ifcopenshell::plugin::manager& manager) {
|
||||
const auto directory = ifcopenshell::serializers::geometry_serializer_plugin_directory();
|
||||
manager.add_search_path(directory);
|
||||
const auto directory = ifcopenshell::plugin::add_search_paths_or_default(
|
||||
manager, &ifcopenshell::serializers::geometry_serializer_plugin_directory);
|
||||
if (directory.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto sibling_directory = directory.parent_path().parent_path() / "serializers" / directory.filename();
|
||||
if (sibling_directory != directory && std::filesystem::exists(sibling_directory)) {
|
||||
|
||||
Reference in New Issue
Block a user