Ninja: Cache target-level flags

Instead of figuring out target flags per-source file, cache the flags
that are being used. This results in a *much* faster generate time for
Ninja.
Merge topic 'dev/ninja-speedup' into next

26762e16 Ninja: Cache target-level flags
Merge topic 'osx-sysroot-escape'

77b2e6f1 OS X: Escape path given to -isysroot flag
Merge topic 'dev/ninja-speedup'

26762e16 Ninja: Cache target-level flags
Merge branch 'master' into next