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
diff --git a/site/docs/cpp.md b/site/docs/cpp.md
index 3566dc9..f204b66 100644
--- a/site/docs/cpp.md
+++ b/site/docs/cpp.md
@@ -177,8 +177,6 @@
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 @@
["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 @@
["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"],
)