Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions pluginlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,6 @@ ament_export_dependencies(ament_index_cpp class_loader rcutils rcpputils tinyxml
ament_export_include_directories(include)
ament_export_targets(${PROJECT_NAME})

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
# Before LLVM 7.0, filesystem is part of experimental
set(FILESYSTEM_LIB c++experimental)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
# Before LLVM 9.0 you have to manually link the fs library
set(FILESYSTEM_LIB c++fs)
else()
# Starting at LLVM 9.0 filesystem is built in
set(FILESYSTEM_LIB)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "QCC")
if(CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+")
set(FILESYSTEM_LIB c++fs)
else()
set(FILESYSTEM_LIB)
endif()
else()
set(FILESYSTEM_LIB stdc++fs)
endif()

if(UNIX AND NOT APPLE)
# this is needed to use the experimental/filesystem on Linux, but cannot be passed with
# ament_export_libraries() because it is not absolute and cannot be found with find_library
target_link_libraries(${PROJECT_NAME}
INTERFACE ${FILESYSTEM_LIB})
endif()

install(
TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
)
Expand All @@ -72,23 +44,6 @@ install(
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)

# NOTE this block is also defined in pluginlib-extras.cmake
# changes here need to be duplicated there
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
# Before LLVM 7.0, filesystem is part of experimental
set(FILESYSTEM_LIB c++experimental)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
# Before LLVM 9.0 you have to manually link the fs library
set(FILESYSTEM_LIB c++fs)
else()
# Starting at LLVM 9.0 filesystem is built in
set(FILESYSTEM_LIB)
endif()
else()
set(FILESYSTEM_LIB stdc++fs)
endif()

include_directories(include test/include)

add_library(test_plugins SHARED ./test/test_plugins.cpp)
Expand Down Expand Up @@ -124,9 +79,6 @@ if(BUILD_TESTING)
TinyXML2
)

if(UNIX AND NOT APPLE)
target_link_libraries(${PROJECT_NAME}_unique_ptr_test ${FILESYSTEM_LIB})
endif()
add_dependencies(${PROJECT_NAME}_unique_ptr_test "${mock_install_target}")
endif()

Expand All @@ -144,9 +96,6 @@ if(BUILD_TESTING)
TinyXML2
)

if(UNIX AND NOT APPLE)
target_link_libraries(${PROJECT_NAME}_utest ${FILESYSTEM_LIB})
endif()
add_dependencies(${PROJECT_NAME}_utest "${mock_install_target}")
endif()

Expand Down
14 changes: 7 additions & 7 deletions pluginlib/include/pluginlib/class_loader_imp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
#include "ament_index_cpp/get_resource.hpp"
#include "ament_index_cpp/get_resources.hpp"
#include "class_loader/class_loader.hpp"
#include "rcpputils/filesystem_helper.hpp"
#include "rcpputils/shared_library.hpp"
#include "rcutils/logging_macros.h"

#include "./class_loader.hpp"
#include "./impl/filesystem_helper.hpp"
#include "./impl/split.hpp"

#ifdef _WIN32
Expand Down Expand Up @@ -510,7 +510,7 @@ std::string ClassLoader<T>::getClassLibraryPath(const std::string & lookup_name)
library_name.c_str());
for (auto it = paths_to_try.begin(); it != paths_to_try.end(); it++) {
RCUTILS_LOG_DEBUG_NAMED("pluginlib.ClassLoader", "Checking path %s ", it->c_str());
if (pluginlib::impl::fs::exists(*it)) {
if (rcpputils::fs::exists(*it)) {
RCUTILS_LOG_DEBUG_NAMED("pluginlib.ClassLoader", "Library %s found at explicit path %s.",
library_name.c_str(), it->c_str());
return *it;
Expand Down Expand Up @@ -587,12 +587,12 @@ ClassLoader<T>::getPackageFromPluginXMLFilePath(const std::string & plugin_xml_f
// 2. Extract name of package from package.xml

std::string package_name;
pluginlib::impl::fs::path p(plugin_xml_file_path);
pluginlib::impl::fs::path parent = p.parent_path();
rcpputils::fs::path p(plugin_xml_file_path);
rcpputils::fs::path parent = p.parent_path();

// Figure out exactly which package the passed XML file is exported by.
while (true) {
if (pluginlib::impl::fs::exists(parent / "package.xml")) {
if (rcpputils::fs::exists(parent / "package.xml")) {
std::string package_file_path = (parent / "package.xml").string();
return extractPackageNameFromPackageXML(package_file_path);
}
Expand All @@ -613,7 +613,7 @@ template<class T>
std::string ClassLoader<T>::getPathSeparator()
/***************************************************************************/
{
return std::string(1, pluginlib::impl::fs::path::preferred_separator);
return std::string(1, rcpputils::fs::kPreferredSeparator);
}


Expand Down Expand Up @@ -647,7 +647,7 @@ template<class T>
std::string ClassLoader<T>::joinPaths(const std::string & path1, const std::string & path2)
/***************************************************************************/
{
pluginlib::impl::fs::path p1(path1);
rcpputils::fs::path p1(path1);
return (p1 / path2).string();
}

Expand Down
195 changes: 0 additions & 195 deletions pluginlib/include/pluginlib/impl/filesystem_helper.hpp

This file was deleted.

21 changes: 0 additions & 21 deletions pluginlib/pluginlib-extras.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,3 @@ ament_register_extension("ament_package" "pluginlib"

include("${pluginlib_DIR}/pluginlib_export_plugin_description_file.cmake")
include("${pluginlib_DIR}/pluginlib_enable_plugin_testing.cmake")

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
# Before LLVM 7.0, filesystem is part of experimental
set(FILESYSTEM_LIB c++experimental)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
# Before LLVM 9.0 you have to manually link the fs library
set(FILESYSTEM_LIB c++fs)
else()
# Starting at LLVM 9.0 filesystem is built in
set(FILESYSTEM_LIB)
endif()
else()
set(FILESYSTEM_LIB stdc++fs)
endif()

if(UNIX AND NOT APPLE)
# this is needed to use the experimental/filesystem on Linux, but cannot be passed with
# ament_export_libraries() because it is not absolute and cannot be found with find_library
list(APPEND pluginlib_LIBRARIES ${FILESYSTEM_LIB})
endif()