Skip to content

Commit

Permalink
Allow factory to read from multiple locations
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Oct 12, 2023
1 parent 9397692 commit 18bf943
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/src/DynamicFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ DynamicFactory::DynamicFactory()
// Load all the descriptors found in the paths set with GZ_DESCRIPTOR_PATH.
this->LoadDescriptors(descPaths);
}
else

auto globalPath =
std::filesystem::path(gz::msgs::getInstallPrefix()) /
"share" / "gz" / "protos";

if (std::filesystem::exists(globalPath))
{
// Load descriptors from the global share path
this->LoadDescriptors((std::filesystem::path(
gz::msgs::getInstallPrefix()) / "share" / "gz" / "protos").string());
this->LoadDescriptors(globalPath.string());
}
}

Expand Down

0 comments on commit 18bf943

Please sign in to comment.