aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/BUILDCONFIG.gn
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-07-21 12:25:45 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-21 12:25:45 -0700
commit7fbfbbe8f435fde7233c78f4f2dd1efb4fdd324c (patch)
tree94d76299873e210f9f9f839ee25138a4a3dd8fe3 /gn/BUILDCONFIG.gn
parent680e2e9a9eea28aa816ecdb88b4af1b4861393a0 (diff)
Basic standalone GN configs.
This sketches out what a world without Chrome's GN configs would look like. Instead of DEPSing in build/, we now host our own gypi_to_gn.py. The symlink from skia/ to . lets us run gclient hooks when the .gclient file is in the directory above skia/ or inside skia/. That means we don't need gn.py anymore. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2167163002 Review-Url: https://codereview.chromium.org/2167163002
Diffstat (limited to 'gn/BUILDCONFIG.gn')
-rw-r--r--gn/BUILDCONFIG.gn69
1 files changed, 69 insertions, 0 deletions
diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn
new file mode 100644
index 0000000000..31056bda5f
--- /dev/null
+++ b/gn/BUILDCONFIG.gn
@@ -0,0 +1,69 @@
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# It's best to keep the names and defaults of is_foo flags consistent with Chrome.
+
+declare_args() {
+ is_debug = true
+ is_component_build = false
+}
+
+# Platform detection
+if (target_os == "") {
+ target_os = host_os
+}
+if (current_os == "") {
+ current_os = target_os
+}
+
+is_android = current_os == "android"
+is_fuchsia = current_os == "fuchsia"
+is_ios = current_os == "ios"
+is_linux = current_os == "linux"
+is_mac = current_os == "mac"
+is_win = current_os == "win"
+
+is_posix = !is_win
+
+# A component is either a source_set or a shared_library.
+template("component") {
+ _component_mode = "source_set"
+ if (is_component_build) {
+ _component_mode = "shared_library"
+ }
+
+ target(_component_mode, target_name) {
+ forward_variables_from(invoker, "*")
+ }
+}
+
+# Default configs
+_default_configs = [ "//gn:default" ]
+if (!is_debug) {
+ _default_configs += [ "//gn:release" ]
+}
+
+set_defaults("executable") {
+ configs = _default_configs + [ "//gn:executable" ]
+}
+
+set_defaults("source_set") {
+ configs = _default_configs
+}
+
+set_defaults("static_library") {
+ configs = _default_configs
+}
+
+set_defaults("shared_library") {
+ configs = _default_configs
+}
+
+set_defaults("component") {
+ configs = _default_configs
+}
+
+# For now, we support GCC-like toolchains, including Clang.
+set_default_toolchain("//gn:gcc_like")