GN: match host and default toolchain + minor cleanups
The major change introduced by this CL is matching
host_toolchain and default_toolchain on pure host builds
(i.e. !android). Today, in fact, when building for
Linux/Mac we still have two toolchains (gcc_like and
gcc_like_host) that happen to have an identical config
(at least in most used configs).
This causes a bunch of subtleties on tools/gen_xxx,
mainy due to the fact of having two targets, both
intended for the host, that happen to use a differently
named toolchain.
This change make it so that when host == target, the host
toolchain is just the default toolchain.
This does not affect chromium / v8 builds.
On top of this, this change makes some minor GN cleanups.
Bug: 140126865
Test: ran tools/gen_all out/mac_debug + full build
Change-Id: I20004c0e23044c64c6dfc10cf50a20875b246c5d
diff --git a/src/protozero/protoc_plugin/BUILD.gn b/src/protozero/protoc_plugin/BUILD.gn
index 88139ed..9cec6b8 100644
--- a/src/protozero/protoc_plugin/BUILD.gn
+++ b/src/protozero/protoc_plugin/BUILD.gn
@@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-if (current_toolchain == host_toolchain) {
- executable("protozero_plugin") {
- sources = [
- "protozero_plugin.cc",
- ]
- deps = [
- "../../../gn:default_deps",
- "../../../gn:protoc_lib",
- ]
- }
-} # host_toolchain
+import("../../../gn/perfetto_host_executable.gni")
+
+perfetto_host_executable("protozero_plugin") {
+ sources = [
+ "protozero_plugin.cc",
+ ]
+ deps = [
+ "../../../gn:default_deps",
+ "../../../gn:protoc_lib",
+ ]
+}