-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Enable C++ 14 flags #2690
Enable C++ 14 flags #2690
Conversation
We had one more item on the "switching on c++14" list:
It turned out this may be problematic on MSVC: #2382 (comment). However, I think it will still be helpful if we have such thing working for at least Ubuntu/macOS. |
Thanks Sérgio. I have updated the PR summary to describe what's going on in more detail. |
Maybe we should force VS 2015 as minimum requirement - depends on which C++ features you want to use. |
Aren't we implicitly forcing this by setting |
Never tried if this checks works, but we have implemented this just in root CMakeLists of PCL and not in PCLConfig.cmake. For installed PCL, check in |
I see your point. I don't really have an opinion here though, I'm not a Windows user. Maybe we wait some time and see how many people show up and file issues. If there are only few, perhaps we don't need this check. |
I am a bit late to the party. In order to not having downstream projects linking against PCL having to explicitly set the c++14 flag, it's a better idea to use something like
so when the downstream target link against pcl targets the c++14 flags will be propagated along with it. Edit: In the case where the downstream is using c++17, it won't cause any problems, the c++14 flags from pcl targets will be superseded by c++17 flags without a problem. |
So the idea would be declare that in PCLConfig.cmake somewhere around here |
Manually setting it in |
This pull request enables C++14 flag for the library, effectively making a C++14 supporting compiler an official requirement. If desired, the user may request to build the library with even newer standard by passing e.g.
-DCMAKE_CXX_STANDARD=17
option to CMake.Note that the flag is not exported to
PCLConfig.cmake
. This means that downstream projects linking against PCL have to explicitly set the flag. This is done to support e.g. using PCL built with C++14 together with downstream projects built with C++17.