This leaves the decision of which C++ version to use up to our users. We still have a static_assert in port_def.inc that will prevent pre-C++14 usage.
PiperOrigin-RevId: 501351066
pull/11472/head
Mike Kruskal2 years agocommitted byCopybara-Service
@ -8,6 +8,19 @@ currently support CMake 3.5 and newer on both [Windows](#windows-builds) and
Most of the instructions will be given using CMake's command-line interface, but
the same actions can be performed using appropriate GUI tools.
# CMake Flags
## C++ Version
By default, CMake will use whatever C++ version is the system default. Since
protobuf requires C++14 or newer, sometimes you will need to explicitly override
this. For example, the following:
cmake . -DCMAKE_CXX_STANDARD=14
cmake --build
will build protobuf using C++14 (see [CXX_STANDARD](https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD){.external} for all available options).
# Windows Builds
On Windows, you can build the project from *Command Prompt* and using an