Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows][ros2] Avoid build break for Visual Studio 2019 v16.3 #135

Merged
merged 2 commits into from
Oct 17, 2019

Conversation

seanyen
Copy link
Contributor

@seanyen seanyen commented Oct 15, 2019

From Visual Studio 2019 v16.3, the usage of the deprecated <experimental/filesystem> is escalated to be a compiler error like below:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\experimental/filesystem(26,1): fatal error C1189: #error:  The <experimental/filesystem> header providing std::experimental::filesystem is deprecated by Microsoft and will be REMOVED. It is superseded by the C++17 <filesystem> header providing std::filesystem. You can define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING to acknowledge that you have received this warning.

There are two ways to do about it:

  1. Since <filesystem> is supported in Visual Studio 2017 v15.7, we can switch to use if __has_include(<filesystem>) && __cplusplus >= 201703L case, however, <filesystem> is considered a C++17 feature, so the whole project needs to target CMAKE_CXX_STANDARD 17 in order to make MSVC enable that, but which seems not to be the target platform for ROS2 Dashing. Hence, I didn't go with that route.

  2. Define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING to acknowledge that for now so it won't break the build. This one looks more conservative but it accommodates the current C++14 configuration.

@seanyen
Copy link
Contributor Author

seanyen commented Oct 15, 2019

This is the same fix applied to pluginlib: ros/pluginlib#164

@seanyen
Copy link
Contributor Author

seanyen commented Oct 16, 2019

cc @mjcarroll

@mjcarroll mjcarroll merged commit e4538a8 into ros-perception:ros2 Oct 17, 2019
@seanyen seanyen mentioned this pull request Oct 17, 2019
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants