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>
This commit is contained in:
Mike Klein 2016-11-13 10:29:25 -05:00 committed by Skia Commit-Bot
parent c6ca9511ca
commit 87c36f2302

View File

@ -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,