[Windows][ros2] Avoid build break for Visual Studio 2019 v16.3 #135
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.
From Visual Studio 2019 v16.3, the usage of the deprecated
<experimental/filesystem>
is escalated to be a compiler error like below:There are two ways to do about it:
Since
<filesystem>
is supported in Visual Studio 2017 v15.7, we can switch to useif __has_include(<filesystem>) && __cplusplus >= 201703L
case, however,<filesystem>
is considered aC++17
feature, so the whole project needs to targetCMAKE_CXX_STANDARD 17
in order to make MSVC enable that, but which seems not to be the target platform forROS2 Dashing
. Hence, I didn't go with that route.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.