mirror of
https://github.com/google/googletest.git
synced 2024-12-26 01:30:49 +08:00
Add CXX_STANDARD_REQUIRED to CMake quickstart
This commit is contained in:
parent
cb455a71fb
commit
aa99ce5a0d
@ -54,6 +54,7 @@ project(my_project)
|
||||
|
||||
# GoogleTest requires at least C++14
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
|
@ -126,10 +126,10 @@ match the project in which it is included.
|
||||
|
||||
An environment that supports C++11 is required in order to successfully build
|
||||
GoogleTest. One way to ensure this is to specify the standard in the top-level
|
||||
project, for example by using the `set(CMAKE_CXX_STANDARD 11)` command. If this
|
||||
is not feasible, for example in a C project using GoogleTest for validation,
|
||||
then it can be specified by adding it to the options for cmake via the
|
||||
`DCMAKE_CXX_FLAGS` option.
|
||||
project, for example by using the `set(CMAKE_CXX_STANDARD 11)` command along
|
||||
with `set(CMAKE_CXX_STANDARD_REQUIRED ON). If this is not feasible, for example
|
||||
in a C project using GoogleTest for validation, then it can be specified by
|
||||
adding it to the options for cmake via the `-DCMAKE_CXX_FLAGS` option.
|
||||
|
||||
### Tweaking GoogleTest
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user