Avoid duplicate C++ standard flags if CMAKE_CXX_STANDARD is set#999
Conversation
CMAKE_CXX_STANDARD is only available on CMake >= 3.1. If the flag is set, we avoid initializing PYBIND11_CPP_STANDARD.
|
This is going to take care of the global, but what if the |
We can't do anything about it as far as I know. It would be set by users after We could conditionally, on CMake >= 3.1, set the per-target All in all, I think it would be best to stick with our existing standard variable and just make this provision for the global |
Fixes #998.
CMAKE_CXX_STANDARDis only available on CMake >= 3.1. If the flag is set, we avoid initializingPYBIND11_CPP_STANDARD.I didn't add any tests because all the CI builds currently rely on
PYBIND11_CPP_STANDARD(for older CMake support) and there's no need to complicate things there.