Skip to content

Commit

Permalink
add pluginlib patch
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Sep 28, 2020
1 parent 6ffbbd8 commit 2a2523e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions patch/ros-noetic-pluginlib.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/include/pluginlib/class_loader_imp.hpp b/include/pluginlib/class_loader_imp.hpp
index d45b591..6b18c37 100644
--- a/include/pluginlib/class_loader_imp.hpp
+++ b/include/pluginlib/class_loader_imp.hpp
@@ -357,12 +357,32 @@ std::vector<std::string> ClassLoader<T>::getAllLibraryPathsToTry(
std::string stripped_library_name = stripAllButFileFromPath(library_name);
std::string stripped_library_name_with_extension = stripped_library_name + non_debug_suffix;

+ #ifdef _WIN32
+ boost::filesystem::path winlib(library_name);
+ std::string additional_lib, stripped_additional_lib;
+ std::string win_filename = winlib.filename().string();
+ if (win_filename.size() >= 3 && win_filename.substr(0, 3) == "lib")
+ {
+ additional_lib = (winlib.remove_filename() / win_filename.substr(3)).string() + non_debug_suffix;
+ stripped_additional_lib = win_filename.substr(3) + non_debug_suffix;
+ }
+ #endif
+
const std::string path_separator = getPathSeparator();

for (unsigned int c = 0; c < all_paths_without_extension.size(); c++) {
std::string current_path = all_paths_without_extension.at(c);
all_paths.push_back(current_path + path_separator + library_name_with_extension);
all_paths.push_back(current_path + path_separator + stripped_library_name_with_extension);
+
+ #ifdef _WIN32
+ if (!additional_lib.empty())
+ {
+ all_paths.push_back(current_path + path_separator + additional_lib);
+ all_paths.push_back(current_path + path_separator + stripped_additional_lib);
+ }
+ #endif
+
// We're in debug mode, try debug libraries as well
if (debug_library_suffix) {
all_paths.push_back(

0 comments on commit 2a2523e

Please sign in to comment.