Auto-generate unique output_name for component() gn targets.

component() target generates shared libraries if
is_component_build=true, which creates .dll/.so files right in the
out/Default directory. This require component() user to come up with a
unique output_name to not clash with already existing libraries, but in
many cases the conflict may not exist and a user doesn't set the unique
output_name. This creates libraries with very generic names such as
"events.dll", "host.dll", "public.dll".

This CL forces gn to generate unique output_name using the target path
and name when output_name is not set explicitly.

Examples of automatic conversions:
events.dll -> ui_events.dll
host.dll -> components_viz_host.dll
public.dll -> components_download_public_common_public.dll

The CL ensures that targets like //base:base or //v8:v8 will have the
same name as before ("base.dll" and "v8.dll" respectively).

Bug: 1407626
Change-Id: I884f83b52106c70b696408d0f4dcac58bd0d71b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166369
Auto-Submit: Aleksey Khoroshilov <akhoroshilov@brave.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096860}
NOKEYCHECK=True
GitOrigin-RevId: 5ad336c9e126f65ce3a0834d8e443d0a8df9ac32
1 file changed