diff options
author | Mike Klein <mtklein@chromium.org> | 2016-11-13 10:29:25 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-14 17:01:57 +0000 |
commit | 87c36f230234b7b5e5d04953d0ac9937cc7f7b5f (patch) | |
tree | 1f07714c816b40fa38ecd5a1b951ee6e2db373e9 /gn/BUILD.gn | |
parent | c6ca9511ca06587f29ce2ddecf814ce440fc1773 (diff) |
GN: detect is_clang cheaply when possible.
Running is_clang.py is the current long-poll in `gn gen` time.
We can avoid it trivially in a few situations:
- We always use Clang on Android, iOS, and Mac.
- If cc and cxx are clang and clang++, it's Clang.
This cuts `gn gen` time from 80ms to 20ms on my laptop.
(Did you know gn has a --tracelog=trace.log option for creating Chrome-tracing-compatible traces? Pretty neat.)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4746
Change-Id: Ic81d221675e8309cc9942bb9e62243d86658b02d
Reviewed-on: https://skia-review.googlesource.com/4746
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gn/BUILD.gn')
-rw-r--r-- | gn/BUILD.gn | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn index 7d94f5a6eb..3c20c96a6b 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -37,7 +37,8 @@ if (host_os == "win") { stamp = "touch" } -if (!is_win) { +is_clang = is_android || is_ios || is_mac || (cc == "clang" && cxx == "clang++") +if (!is_clang && !is_win) { is_clang = exec_script("is_clang.py", [ cc, |