Add the various sanitizers from the GYP setup
Everything doesn't build and many tests don't pass, but the basics are
there.
Change-Id: I6d1219077318d9e168a81d9c3f620a8f77c97c96
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index 9196d44..f6203eb 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -1,10 +1,17 @@
package(default_visibility = ['//visibility:public'])
cc_library(
+ name = 'empty_main',
+ srcs = [ 'empty_main.c' ],
+)
+
+cc_library(
name = 'malloc',
- deps = [
- '//third_party/gperftools:tcmalloc',
- ],
+ deps = select({
+ '//tools:has_asan': [],
+ '//tools:has_tsan': [],
+ '//conditions:default': ['//third_party/gperftools:tcmalloc'],
+ }),
)
cc_library(
diff --git a/tools/cpp/empty_main.c b/tools/cpp/empty_main.c
new file mode 100644
index 0000000..79996de
--- /dev/null
+++ b/tools/cpp/empty_main.c
@@ -0,0 +1,3 @@
+// Used by //tools/build_rules:empty_main.bzl.
+
+int main() {}