diff --git a/resources/pybind11/include/pybind11/common.h b/resources/pybind11/include/pybind11/common.h index af0a8d0..95c0d75 100755 --- a/resources/pybind11/include/pybind11/common.h +++ b/resources/pybind11/include/pybind11/common.h @@ -19,7 +19,7 @@ #if !defined(_MSC_VER) && !defined(__INTEL_COMPILER) # if __cplusplus >= 201402L # define PYBIND11_CPP14 -# if __cplusplus > 201402L /* Temporary: should be updated to >= the final C++17 value once known */ +# if __cplusplus >= 201703L /* Temporary: should be updated to >= the final C++17 value once known */ # define PYBIND11_CPP17 # endif # endif diff --git a/resources/pybind11/include/pybind11/stl.h b/resources/pybind11/include/pybind11/stl.h index 535eb49..eb75448 100755 --- a/resources/pybind11/include/pybind11/stl.h +++ b/resources/pybind11/include/pybind11/stl.h @@ -30,7 +30,7 @@ # define PYBIND11_HAS_OPTIONAL 1 # endif // std::experimental::optional (but not allowed in c++11 mode) -# if defined(PYBIND11_CPP14) && __has_include() +# if defined(PYBIND11_CPP14) && __has_include() && !__has_include() # include # define PYBIND11_HAS_EXP_OPTIONAL 1 # endif diff --git a/resources/pybind11/tools/pybind11Tools.cmake b/resources/pybind11/tools/pybind11Tools.cmake index 1290484..94aa8ca 100755 --- a/resources/pybind11/tools/pybind11Tools.cmake +++ b/resources/pybind11/tools/pybind11Tools.cmake @@ -21,10 +21,13 @@ include(CMakeParseArguments) function(select_cxx_standard) if(NOT PYBIND11_CPP_STANDARD) if(NOT MSVC) + check_cxx_compiler_flag("-std=c++17" HAS_CPP17_FLAG) check_cxx_compiler_flag("-std=c++14" HAS_CPP14_FLAG) check_cxx_compiler_flag("-std=c++11" HAS_CPP11_FLAG) - if (HAS_CPP14_FLAG) + if (HAS_CPP17_FLAG) + set(PYBIND11_CPP_STANDARD -std=c++17) + elseif (HAS_CPP14_FLAG) set(PYBIND11_CPP_STANDARD -std=c++14) elseif (HAS_CPP11_FLAG) set(PYBIND11_CPP_STANDARD -std=c++11)