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/BUILD.gn b/BUILD.gn
index 61d6d9d..0a10260 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -159,12 +159,15 @@
# Android tree.
if (enable_perfetto_platform_services) {
if (monolithic_binaries) {
- libperfetto_target_type = "source_set"
+ libperfetto_target_type = "static_library"
} else {
libperfetto_target_type = "shared_library"
}
target(libperfetto_target_type, "libperfetto") {
+ if (libperfetto_target_type == "static_library") {
+ complete_static_lib = true
+ }
deps = [
"gn:default_deps",
"src/traced/probes",