Fix //tools/gn/example on Linux: missing current_os and related vars

The example GN project's BUILDCONIG.gn needs to set {target,current}_{os,cpu)
variables like the Chromium BUILDCONFIG file does. Otherwise some conditionals
don't work like they do in Chromium and the project doesn't link on Linux,
which is needlessly confusing.

To test, `gn gen out' in //tools/gn/example, and then `ninja -C out'.

R=brettw@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1429073002

Cr-Original-Commit-Position: refs/heads/master@{#357329}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 763cdd3e2a8143c6c4a7b0991579dd21aaf1aeac
diff --git a/tools/gn/example/build/BUILDCONFIG.gn b/tools/gn/example/build/BUILDCONFIG.gn
index d107908..e419fd9 100644
--- a/tools/gn/example/build/BUILDCONFIG.gn
+++ b/tools/gn/example/build/BUILDCONFIG.gn
@@ -2,6 +2,19 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+if (target_os == "") {
+  target_os = host_os
+}
+if (target_cpu == "") {
+  target_cpu = host_cpu
+}
+if (current_cpu == "") {
+  current_cpu = target_cpu
+}
+if (current_os == "") {
+  current_os = target_os
+}
+
 # All binary targets will get this list of configs by default.
 _shared_binary_target_configs = [ "//build:compiler_defaults" ]