Conversation
This allows us to use std::filesystem, as the logic in filesystem_helper sniffs the current c++ standard. CMake should fall back gracefully to c++14 if c++17 is not available.
|
Thanks for the contribution. However, with ros-infrastructure/rep@953a64d C++14 is still going to be the target C++ standard for Foxy. So this PR will have to wait. The community discussion which prompted the change starts with ros-infrastructure/rep#217 (comment) |
|
@nuclearsandwich I know we're targeting C++14 but I still believe this PR was correct as written. even if we're targeting CMake 14, setting
The conditional here |
|
Thanks for the added context. I'd re-open the PR now but GitHub is preventing me from doing so since the branch has been "force-pushed or recreated".
Thanks for the info and doc link. I didn't know about the decay behavior in CMAKE_CXX_STANDARD. That certainly makes this discussion worth re-opening.
Acknowleged, that handles the case we know to handle. Which brings me to my two main concerns with the standard bump which may or may not be well-founded: 1.Bumping the standard for this opens up the possibility of unintentionally adding more C++17-only features without noticing right away as none of our tier one platform compilers lack C++17 support.
I don't disagree. I tried a few things locally before settling for suppressing the warning. Clang 10 doesn't provide a clean way to use either experimental/filesystem or std::filesystem from C++14 without suppressing the warning. I'm not sure whether I like the idea of only setting CMAKE_CXX_STANDARD to 17 when Clang>=9 is detected but it does at least ensure that the other platforms are testing the C++14 path. |
I can open a new PR.
Agreed. It's a consequence of trying to implement it in the header, which means you impose additional restrictions on downstream packages. pluginlib-extras.cmake
Please meditate on this! Clang is in the right:
|
This allows us to use std::filesystem, as the logic in filesystem_helper sniffs the current c++ standard. CMake should fall back gracefully to c++14 if c++17 is not available.