summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShlomi Nissan <shlomi@betamark.com>2023-05-21 23:40:06 (GMT)
committerShlomi Nissan <shlomi@betamark.com>2023-05-21 23:40:06 (GMT)
commitaa99ce5a0db4215bb8e2cda3ee68b6b8d4896815 (patch)
tree034ce03164729fca3b97b002a2ffe7b047b4df95
parentcb455a71fb23303e37ce8ee5b1cde6a2c18f66a5 (diff)
downloadgoogletest-aa99ce5a0db4215bb8e2cda3ee68b6b8d4896815.zip
googletest-aa99ce5a0db4215bb8e2cda3ee68b6b8d4896815.tar.gz
googletest-aa99ce5a0db4215bb8e2cda3ee68b6b8d4896815.tar.bz2
Add CXX_STANDARD_REQUIRED to CMake quickstartrefs/pull/4250/head
-rw-r--r--docs/quickstart-cmake.md1
-rw-r--r--googletest/README.md8
2 files changed, 5 insertions, 4 deletions
diff --git a/docs/quickstart-cmake.md b/docs/quickstart-cmake.md
index 5abe504..4e422b7 100644
--- a/docs/quickstart-cmake.md
+++ b/docs/quickstart-cmake.md
@@ -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(
diff --git a/googletest/README.md b/googletest/README.md
index 995834e..dc60571 100644
--- a/googletest/README.md
+++ b/googletest/README.md
@@ -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