aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2015-12-22 20:40:50 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2015-12-22 21:38:45 +0000
commitc83c300d084819c03326a1c33ad5c2a9c1fcc31d (patch)
tree3ab1b9f751f3c5c1d512224ee7a7e36fc4abb9a1 /site
parent1ea7fc370f0605be2185868f9371f6e04c26a502 (diff)
Update C++ gtest example to include all headers in sandbox
This was originally written before sandboxing was enabled and I didn't notice that src/ contained a header. I've also removed the -Iexternal/gtest lines, since they're no longer needed. Fixes #734. -- MOS_MIGRATED_REVID=110790783
Diffstat (limited to 'site')
-rw-r--r--site/docs/cpp.md18
1 files changed, 9 insertions, 9 deletions
diff --git a/site/docs/cpp.md b/site/docs/cpp.md
index 3566dc9f3a..f204b663d1 100644
--- a/site/docs/cpp.md
+++ b/site/docs/cpp.md
@@ -177,8 +177,6 @@ more complicated:
link errors for duplicate symbols.
* It uses header files that relative to the `gtest-1.7.0/include/` directory
(`"gtest/gtest.h"`), so we must add that directory the include paths.
-* It uses "private" header files in `src/`, so we add that to the include pahs,
- too, so it can `#include "src/gtest-internal-inl.h"`.
* It needs to link in pthread, so we add that as a `linkopt`.
The final rule looks like this:
@@ -190,9 +188,11 @@ cc_library(
["gtest-1.7.0/src/*.cc"],
exclude = ["gtest-1.7.0/src/gtest-all.cc"]
),
- hdrs = glob(["gtest-1.7.0/include/**/*.h"]),
+ hdrs = glob([
+ "gtest-1.7.0/include/**/*.h",
+ "gtest-1.7.0/src/*.h"
+ ]),
copts = [
- "-Iexternal/gtest/gtest-1.7.0",
"-Iexternal/gtest/gtest-1.7.0/include"
],
linkopts = ["-pthread"],
@@ -223,11 +223,11 @@ cc_library(
["src/*.cc"],
exclude = ["src/gtest-all.cc"]
),
- hdrs = glob(["include/**/*.h"]),
- copts = [
- "-Iexternal/gtest",
- "-Iexternal/gtest/include"
- ],
+ hdrs = glob([
+ "include/**/*.h",
+ "src/*.h"
+ ]),
+ copts = ["-Iexternal/gtest/include"],
linkopts = ["-pthread"],
visibility = ["//visibility:public"],
)