Skip to content

Commit

Permalink
Fix IGN_LAUNCH_PLUGIN_PATH logic
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed May 26, 2022
1 parent feb94cd commit a2c3ecf
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1096,12 +1096,12 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem)
std::string homePath;
gz::common::env(IGN_HOMEDIR, homePath);

// TODO(CH3): Deprecated. Remove on ticktock.
systemPaths.AddPluginPaths(
gz::common::joinPaths(homePath, ".ignition", "gazebo", "plugins"));
gz::common::joinPaths(homePath, ".gz", "sim", "plugins"));

// TODO(CH3): Deprecated. Remove on ticktock.
systemPaths.AddPluginPaths(
gz::common::joinPaths(homePath, ".gz", "sim", "plugins"));
gz::common::joinPaths(homePath, ".ignition", "gazebo", "plugins"));

std::string pathToLib;
if (common::exists(file))
Expand All @@ -1116,6 +1116,13 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem)
// GZ_LAUNCH_PLUGIN_PATH
systemPaths.SetPluginPathEnv("IGN_LAUNCH_PLUGIN_PATH");
pathToLib = systemPaths.FindSharedLibrary(file);

if (!pathToLib.empty())
{
gzwarn << "Found plugin [" << pathToLib
<< "] using deprecated environment variable [IGN_LAUNCH_PLUGIN_PATH]."
" Please use [GZ_LAUNCH_PLUGIN_PATH] instead." << std::endl;
}
}

if (pathToLib.empty())
Expand All @@ -1125,12 +1132,6 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem)
<< "variable.\n";
return;
}
else
{
gzwarn << "Found plugin [" << pathToLib
<< "] using deprecated environment variable [IGN_LAUNCH_PLUGIN_PATH]."
" Please use [GZ_LAUNCH_PLUGIN_PATH] instead." << std::endl;
}

plugin::Loader loader;
std::unordered_set<std::string> localPlugins = loader.LoadLib(pathToLib);
Expand Down

0 comments on commit a2c3ecf

Please sign in to comment.