Fix build rules in tools

Prior to this CL tools/gen_all would fail if the output directory
passed is non-host-only (e.g., android_xxx).

Change-Id: I0f8aa6f4b4c4b566da8959cd637ba9152fca927f
diff --git a/gn/perfetto_unittests.gni b/gn/perfetto_unittests.gni
index e7c5a44..361b83c 100644
--- a/gn/perfetto_unittests.gni
+++ b/gn/perfetto_unittests.gni
@@ -22,13 +22,15 @@
   "src/tracing:unittests",
 ]
 
-if (enable_perfetto_tools) {
-  perfetto_unittests_targets += [
-    "tools/ftrace_proto_gen:unittests",
-    "tools/sanitizers_unittests",
-  ]
+if (enable_perfetto_tools && current_toolchain == host_toolchain) {
+  perfetto_unittests_targets += [ "tools/ftrace_proto_gen:unittests" ]
 }
 
+# TODO(primiano): sanitizers_unittests shouldn't really be under tools. It's
+# not a tool and it's intended to run on both host and targets to check that
+# sanitizers are actually working.
+perfetto_unittests_targets += [ "tools/sanitizers_unittests" ]
+
 if (enable_perfetto_ipc) {
   perfetto_unittests_targets += [ "src/ipc:unittests" ]
 }