This makes it considerably easier to use ccache with the Android NDK.
You can now just set
compiler_prefix = "ccache"
ndk = "/path/to/ndk"
and we'll use the NDK clang, wrapped with ccache.
The name compiler_prefix is stolen from / compatible with Chrome.
If you have ccache, you can just always leave compiler_prefix="ccache" enabled.
This should make it an unusual thing for humans to have to change cc or cxx.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2281163002
Review-Url: https://codereview.chromium.org/2281163002
Once you have downloaded an android NDK, you can set the ndk GN arg to use it.
E.g. my gn.args looks like:
is_debug = false
ndk = "/opt/android-ndk"
This should be enough to get you going for an arm64 build. You ought to be able to tweak that to other architectures by changing target_cpu to "arm", "x86", "x86-64", etc. That won't quite work until I follow this up a bit, but the skeleton is there.
This is enough to get me compiled, linked, and running to completion on my N5x.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2275983004
Review-Url: https://codereview.chromium.org/2275983004
- Use options' template pattern for opts too.
- Simplify opt's and options' configs... they should all be the same.
- When building a static-library component in our GN environment (i.e. libskia.a),
make it a complete static lib, fully containing its transitive deps.
- It has not proved useful to override ar.
TBR=jcgregorio@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2278673002
Review-Url: https://codereview.chromium.org/2278673002
Adding flags to the end of cc or cxx is pretty useful, but these always end up
on the command line before the GN generated flags, thus setting defaults that
GN will override.
For full flexibility we want to be able to add flags after the flags GN has
added, so that custom flags can override _it_.
I've updated the Fast bots with an example here: if we said cc="clang -O3 ...",
that '-O3' would be overriden later by the default Release-mode '-Os'. By
putting it in extra_cflags, we get the last word: our '-O3' overrides the
default '-Os'.
Another good use case is a hypothetical Actually-Shippable-Release mode. Our
Release mode bundles in tons of debug symbols via '-g'. libskia.a is about 10x
larger than it needs to be when built that way, but it helps us debug the bot
failures immensely. To build a libskia.{a,so} that you'd really ship, you can
now set extra_cflags="-g0" to override '-g'. You could set '-march' flags there
too, '-fomit-frame-pointer', etc.
There are lots of flags that won't matter where they end up in the command line.
To keep everything simple I've put them in extra_cflags with the rest. This means
the only time we change 'cc' or 'cxx' in our recipes is to prefix 'ccache'.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241263003
Review-Url: https://codereview.chromium.org/2241263003
This should help make the bot logs a little easier to read. (On the console
this wasn't much of a big deal, as Ninja auto-abbreviates when printing to an
interactive console.)
As usual, Ninja will print the full command when a task fails.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2188263002
Review-Url: https://codereview.chromium.org/2188263002
These flags hide symbols that are not marked with SK_API when linked into a
shared library. There's nominally no effect on static linking, but I'm
pretty sure the Mac linker takes some advantage of this too to run faster.
This makes component-build DM no longer link: it uses many non SK_API APIs.
Fiddle in contrast is just fine with our public APIs, so no need to restrict that.
It'll be fun finding out which of our other tools go which ways.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2180383003
Review-Url: https://codereview.chromium.org/2180383003
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