adjust library search to work on windows, warn about lib prefix#97
Merged
adjust library search to work on windows, warn about lib prefix#97
Conversation
This was referenced Jan 23, 2018
Member
|
Thanks @wjwwood, I'll have a look soon |
Member
Author
mikaelarguedas
approved these changes
Jan 23, 2018
| }; | ||
|
|
||
| // Prepare to setup the relative file paths. | ||
| bool debug_library_suffix = (0 == class_loader::systemLibrarySuffix().compare(0, 1, "d")); |
Member
There was a problem hiding this comment.
Note that currently systemLibrarySuffix will always return the non debug version (but that's great to keep logic for handling both)
| const char * lib_prefix = "lib"; | ||
| if (library_name.rfind(lib_prefix, 0) == 0) { | ||
| library_name_alternative = library_name.substr(strlen(lib_prefix)); | ||
| RCUTILS_LOG_WARN_NAMED("pluginlib.ClassLoader", |
Member
There was a problem hiding this comment.
👍 thanks for adding the warning that'll help converge to the new way of defining them
Member
Author
|
Thanks for the quick review @mikaelarguedas 👍 |
wjwwood
added a commit
that referenced
this pull request
Feb 8, 2018
* remove references to plugin_tool from CMakeLists (#93) * move pluginlib in its own folder (port 83 to ros2 branch) (#95) * move pluginlib in its own folder (port 83 to ros2 branch) * fix most linter errors * forward port of #88 Continue loading classes on error * vs2015 doesnt support __has_include, VS2015 and 2017 have both <files… (#96) * windows contains older version of std filesystem * either <experimental/filesystem> or <filesystem> will work ... use experimental to be namespace-consistent * vs2015 doesnt support __has_include, VS2015 and 2017 have both <filesystem> and <experimental/filesystem> but use std::experimental::filesystem in both cases * adjust library search to work on windows, warn about lib prefix (#97)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is required for rviz to load
.dll's on Windows which reside inbin. Also, all users are probably including the implicitlibprefix for their libraries explicitly, e.g.:https://github.com/ros2/rviz/blob/4e10a6925d8db08e539ea54997abeb1ed6226767/rviz_default_plugins/plugins_description.xml#L1
This is not so portable because the cmake code uses
<library_name>which generates a library likelib<library_name>.soon Linux andlib<library_name>.dylibon macOS, but<library_name>.dllon Windows.So, I added the ability for pluginlib to search with and without the
libprefix, i.e. if you givelibfooit will also search forfoo, and if you givefooit will also search forlibfoo. However, giving slight preference to the user input without thelibprefix, I added a warning that prints if you givelibfoowhich suggests you usefooinstead.Long term, I think we should deprecate this searching and instead use compile time information to store the actual location (relative or absolute) of the library and simply match that with what is in the plugin description
.xmlby name.