Add exe_and_shlib_deps to executable and shared_library configs

Currently, all executables and shared libraries are expected to add the
exe_and_shlib_deps dependency manually.  However, it is easy to forget to do
this.  In such cases, the build will likely fail at the link step due to missing
libc++ symbols.  It may not be obvious how to fix this issue.

This CL adds exe_and_shlib_deps as an implicit dependency to executable and
shared_library targets so that developers don't have to manually add it.

BUG=845700
R=dpranke
TBR=torne

Change-Id: I30edcf0bcd6559b1aaa211a42863b04bc57d4d99
Reviewed-on: https://chromium-review.googlesource.com/1069720
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#561729}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d7ed1f0a9c28c932fddc834ca5de44f28266c7f5
diff --git a/tools/gn/BUILD.gn b/tools/gn/BUILD.gn
index 31e2493..1e171fa 100644
--- a/tools/gn/BUILD.gn
+++ b/tools/gn/BUILD.gn
@@ -6,8 +6,6 @@
 import("//testing/test.gni")
 import("//testing/libfuzzer/fuzzer_test.gni")
 
-defines = [ "GN_BUILD" ]
-
 jumbo_static_library("gn_lib") {
   configs += [ "//build/config:precompiled_headers" ]
 
@@ -263,6 +261,7 @@
 # of GN over the large Chrome build, you will want to set the arg:
 #   enable_iterator_debugging = false
 executable("gn") {
+  defines = [ "GN_BUILD" ]
   sources = [
     "gn_main.cc",
   ]