Windows contains older version of std filesystem (still experimental)#92
Windows contains older version of std filesystem (still experimental)#92
Conversation
|
Thanks @bfjelds for the contribution. I have 2 questions regarding filesystem on Windows:
I'll let @wjwwood review this as well as he's been the one implementing this filesystem helper. |
|
These are great questions...I was focused on getting pluginlib to build 8n the context of implementing laser_filters, but was using VS2017. I'll investigate further in about a week and see if I can't get some definitive answers :) |
…perimental to be namespace-consistent
|
The v1 is an inline namespace (new to me!) ... if we wanted to refer specifically to v1, we could, but it isn't required. <experimental/filesystem> is a wrapper around at this point, so either would work. I went with experimental/filesystem to be consistent with the namespace. This was all verified on VS2015 Update 3 and VS2017. |
mikaelarguedas
left a comment
There was a problem hiding this comment.
Thanks @bfjelds for checking this.
The code looks good to me, I have one comment regarding the MSC_VER check.
After looking a bit into it, it seems that we need this special case for MSVC only because VS2015 doesn't support __has_include whereas VS2017, gcc and clang implement the feature. I think it failed to build for you with VS2017 beccause both <filesystem> and <experimental/filesystem> are present, and as we check the presence of <filesystem> first you ended up with namespace fs = std::filesystem; while the Windows implementation is under the namespace std::experimental::filesystem.
| #define PLUGINLIB__IMPL__FILESYSTEM_HELPER_HPP_ | ||
|
|
||
| #if defined(__has_include) | ||
| #if defined(_MSC_VER) |
There was a problem hiding this comment.
I think it would make sense to compare the value to a minimal version of compiler as some Windows platforms with an older compiler will have the variable defined but not the filesystem header. I didnt track down the first version of MSVC implementing it but as we target VS2015 Update3 we should be safe by requiring _MSC_VER >= 1900
|
I rebased this branch and added the change I suggested regarding the version check on this branch https://github.com/ros/pluginlib/tree/ros_ros2_mikael. |
|
Confirmed that it builds...looks great, thanks!! |
|
@mikaelarguedas it would be nice to keep @bfjelds's commits as the foundation of the pr, to preserve his attribution, in #92 you can't tell that he had a hand in it from the commits. I'll try to fix up on of these pr's so that it is preserved. |
No description provided.