mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
Document CMAKE_CXX_STANDARD
This variable is a CMake community standard to set the C++ standard of a build. Document it in favor of the previous variable, which stays as a legacy flag for existing projects. https://cmake.org/cmake/help/v3.17/variable/CMAKE_CXX_STANDARD.html
This commit is contained in:
parent
d730fbc0d5
commit
6ebfc4b2b0
@ -105,18 +105,14 @@ on the target compiler, falling back to C++11 if C++14 support is not
|
|||||||
available. Note, however, that this default is subject to change: future
|
available. Note, however, that this default is subject to change: future
|
||||||
pybind11 releases are expected to migrate to newer C++ standards as they become
|
pybind11 releases are expected to migrate to newer C++ standards as they become
|
||||||
available. To override this, the standard flag can be given explicitly in
|
available. To override this, the standard flag can be given explicitly in
|
||||||
``PYBIND11_CPP_STANDARD``:
|
`CMAKE_CXX_STANDARD <https://cmake.org/cmake/help/v3.17/variable/CMAKE_CXX_STANDARD.html>`_:
|
||||||
|
|
||||||
.. code-block:: cmake
|
.. code-block:: cmake
|
||||||
|
|
||||||
# Use just one of these:
|
# Use just one of these:
|
||||||
# GCC/clang:
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(PYBIND11_CPP_STANDARD -std=c++11)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(PYBIND11_CPP_STANDARD -std=c++14)
|
set(CMAKE_CXX_STANDARD 17) # Experimental C++17 support
|
||||||
set(PYBIND11_CPP_STANDARD -std=c++1z) # Experimental C++17 support
|
|
||||||
# MSVC:
|
|
||||||
set(PYBIND11_CPP_STANDARD /std:c++14)
|
|
||||||
set(PYBIND11_CPP_STANDARD /std:c++latest) # Enables some MSVC C++17 features
|
|
||||||
|
|
||||||
add_subdirectory(pybind11) # or find_package(pybind11)
|
add_subdirectory(pybind11) # or find_package(pybind11)
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
#
|
#
|
||||||
# Python headers, libraries (as needed by platform), and the C++ standard
|
# Python headers, libraries (as needed by platform), and the C++ standard
|
||||||
# are attached to the target. Set PythonLibsNew variables to influence
|
# are attached to the target. Set PythonLibsNew variables to influence
|
||||||
# python detection and PYBIND11_CPP_STANDARD (-std=c++11 or -std=c++14) to
|
# python detection and CMAKE_CXX_STANDARD (11 or 14) to influence standard
|
||||||
# influence standard setting. ::
|
# setting. ::
|
||||||
#
|
#
|
||||||
# find_package(pybind11 CONFIG REQUIRED)
|
# find_package(pybind11 CONFIG REQUIRED)
|
||||||
# message(STATUS "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}")
|
# message(STATUS "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}")
|
||||||
|
Loading…
Reference in New Issue
Block a user