[reland] Support generation of component targets for Mojom C++ bindings

NOTE: Reland of https://chromium-review.googlesource.com/c/504707/,
with device/vr fixed. The original CL caused device/vr to produce a
totally empty shared library in component builds (previously it would
export only the mojom symbols, which this CL moves to a new component.)
Apparently this doesn't trigger any kind of build error, but Windows fails
to load an executable that has a dependency on the empty DLL. This revised
CL makes the empty device/vr target a source_set rather than a component.

This allows developers to force the mojom GN template to emit a
component target for C++ bindings rather than a source_set and updates
some existing uses of the export_class_attribute etc parameters to use
explicit component generation instead.

This is a step towards using mojom component targets by default, but
that is currently impossible without additional GN support.

BUG=718098
TBR=jam@chromium.org
TBR=yzshen@chromium.org

Change-Id: I4b1eb19b3dc11c44cc8793773e850f8b8d4906e5
Reviewed-on: https://chromium-review.googlesource.com/505418
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#471574}

CrOS-Libchrome-Original-Commit: fe0424e7b5377b4ebe5109d3bc2dd910005de7af
9 files changed
tree: 5c3156a23ce763fb209f166afe86e27e409d0824
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/