aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-10-04 17:09:13 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-04 21:57:31 +0000
commit121563eb4a0203a8b85ea5fe7caedf6fb35f04bf (patch)
treef68daaf6384103336fe7f6ea831202df01b44955 /gn
parent433b306a705e026c93335a90bd056b6e8121bfac (diff)
Fold extra_*_flags into GN as a config.
This should make them visible to things like gn_to_cmake.py. I'm not exactly sure what this implies about ordering and overriding. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2938 Change-Id: I0740613993fb5bbfb8363cfa126d1f59768abf60 Reviewed-on: https://skia-review.googlesource.com/2938 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn')
-rw-r--r--gn/BUILD.gn33
-rw-r--r--gn/BUILDCONFIG.gn3
2 files changed, 21 insertions, 15 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 0c60ac8e1f..5622149d0c 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -16,10 +16,10 @@ declare_args() {
windk = ""
- extra_cflags = ""
- extra_cflags_c = ""
- extra_cflags_cc = ""
- extra_ldflags = ""
+ extra_cflags = []
+ extra_cflags_c = []
+ extra_cflags_cc = []
+ extra_ldflags = []
cc_wrapper = ""
}
@@ -228,6 +228,13 @@ config("default") {
}
}
+config("extra_flags") {
+ cflags = extra_cflags
+ cflags_c = extra_cflags_c
+ cflags_cc = extra_cflags_cc
+ ldflags = extra_ldflags
+}
+
config("debug_symbols") {
# It's annoying to wait for full debug symbols to push over
# to Android devices. -gline-tables-only is a lot slimmer.
@@ -365,24 +372,22 @@ toolchain("gcc_like") {
tool("cc") {
depfile = "{{output}}.d"
- command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} $extra_cflags $extra_cflags_c -c {{source}} -o {{output}}"
+ command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
depsformat = "gcc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
]
- description =
- "$cc_wrapper $cc ... $extra_cflags $extra_cflags_c -o {{output}}"
+ description = "$cc_wrapper $cc ... -o {{output}}"
}
tool("cxx") {
depfile = "{{output}}.d"
- command = "$cc_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} $extra_cflags $extra_cflags_cc -c {{source}} -o {{output}}"
+ command = "$cc_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
]
- description =
- "$cc_wrapper $cxx ... $extra_cflags $extra_cflags_cc -o {{output}}"
+ description = "$cc_wrapper $cxx ... -o {{output}}"
}
tool("asm") {
@@ -413,21 +418,21 @@ toolchain("gcc_like") {
rpath = "-Wl,-install_name,@rpath/$soname"
}
- command = "$cc_wrapper $cxx -shared {{ldflags}} {{inputs}} {{solibs}} {{libs}} $rpath $extra_ldflags -o {{output}}"
+ command = "$cc_wrapper $cxx -shared {{ldflags}} {{inputs}} {{solibs}} {{libs}} $rpath -o {{output}}"
outputs = [
"{{root_out_dir}}/$soname",
]
output_prefix = "lib"
default_output_extension = ".so"
- description = "$cc_wrapper $cxx -shared ... $extra_ldflags -o {{output}}"
+ description = "$cc_wrapper $cxx -shared ... -o {{output}}"
}
tool("link") {
- command = "$cc_wrapper $cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}} $extra_ldflags -o {{output}}"
+ command = "$cc_wrapper $cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}} -o {{output}}"
outputs = [
"{{root_out_dir}}/{{target_output_name}}{{output_extension}}",
]
- description = "$cc_wrapper $cxx ... $extra_ldflags -o {{output}}"
+ description = "$cc_wrapper $cxx ... -o {{output}}"
}
tool("stamp") {
diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn
index 84e092426b..2f8670a563 100644
--- a/gn/BUILDCONFIG.gn
+++ b/gn/BUILDCONFIG.gn
@@ -125,9 +125,10 @@ if (!is_debug) {
if (!is_official_build) {
default_configs += [ "//gn:debug_symbols" ]
}
+default_configs += [ "//gn:extra_flags" ]
set_defaults("executable") {
- configs = default_configs + [ "//gn:executable" ]
+ configs = [ "//gn:executable" ] + default_configs
}
set_defaults("source_set") {