diff options
author | mtklein <mtklein@chromium.org> | 2016-08-25 14:50:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-25 14:50:44 -0700 |
commit | 7d6fb2c92d096ac3630e23d561a4077a974a815c (patch) | |
tree | 73f270ac1a7fb82e00ef08b3f5615a46b99bf312 /third_party | |
parent | 44df651ebefc284acc2f66425dff3ea0b0e14b36 (diff) |
GN: Android
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
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/BUILD.gn | 8 | ||||
-rw-r--r-- | third_party/cpu-features/BUILD.gn | 17 | ||||
-rw-r--r-- | third_party/freetype2/BUILD.gn | 63 | ||||
-rw-r--r-- | third_party/icu/BUILD.gn | 6 | ||||
-rw-r--r-- | third_party/libpng/BUILD.gn | 7 | ||||
-rw-r--r-- | third_party/libwebp/BUILD.gn | 6 | ||||
-rw-r--r-- | third_party/sfntly/BUILD.gn | 1 |
7 files changed, 94 insertions, 14 deletions
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn index 49d9f568c4..63fa748d16 100644 --- a/third_party/BUILD.gn +++ b/third_party/BUILD.gn @@ -6,14 +6,6 @@ declare_args() { } -config("system_freetype2") { - include_dirs = [ "/usr/include/freetype2" ] - libs = [ "freetype" ] -} -group("freetype2") { - public_configs = [ ":system_freetype2" ] -} - config("system_fontconfig") { libs = [ "fontconfig" ] } diff --git a/third_party/cpu-features/BUILD.gn b/third_party/cpu-features/BUILD.gn new file mode 100644 index 0000000000..d1f6fad089 --- /dev/null +++ b/third_party/cpu-features/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright 2016 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { +} + +import("../third_party.gni") + +third_party("cpu-features") { + public_include_dirs = [ "$ndk/sources/android/cpufeatures" ] + + sources = [ + "$ndk/sources/android/cpufeatures/cpu-features.c", + ] +} diff --git a/third_party/freetype2/BUILD.gn b/third_party/freetype2/BUILD.gn new file mode 100644 index 0000000000..623c47eb83 --- /dev/null +++ b/third_party/freetype2/BUILD.gn @@ -0,0 +1,63 @@ +# Copyright 2016 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { +} + +import("../third_party.gni") + +if (is_android) { + third_party("freetype2") { + public_include_dirs = [ "../externals/freetype/include" ] + + deps = [ + "//third_party/libpng", + ] + + include_dirs = [ "../freetype" ] + defines = [ + "FT2_BUILD_LIBRARY", + "FT_CONFIG_MODULES_H=<include/freetype-android/ftmodule.h>", + "FT_CONFIG_OPTIONS_H=<include/freetype-android/ftoption.h>", + ] + + sources = [ + "../externals/freetype/src/autofit/autofit.c", + "../externals/freetype/src/base/ftbase.c", + "../externals/freetype/src/base/ftbbox.c", + "../externals/freetype/src/base/ftbitmap.c", + "../externals/freetype/src/base/ftdebug.c", + "../externals/freetype/src/base/ftfntfmt.c", + "../externals/freetype/src/base/ftfstype.c", + "../externals/freetype/src/base/ftgasp.c", + "../externals/freetype/src/base/ftglyph.c", + "../externals/freetype/src/base/ftinit.c", + "../externals/freetype/src/base/ftlcdfil.c", + "../externals/freetype/src/base/ftmm.c", + "../externals/freetype/src/base/ftpatent.c", + "../externals/freetype/src/base/ftstroke.c", + "../externals/freetype/src/base/ftsynth.c", + "../externals/freetype/src/base/ftsystem.c", + "../externals/freetype/src/base/fttype1.c", + "../externals/freetype/src/base/ftwinfnt.c", + "../externals/freetype/src/cff/cff.c", + "../externals/freetype/src/gzip/ftgzip.c", + "../externals/freetype/src/pshinter/pshinter.c", + "../externals/freetype/src/psnames/psnames.c", + "../externals/freetype/src/raster/raster.c", + "../externals/freetype/src/sfnt/sfnt.c", + "../externals/freetype/src/smooth/smooth.c", + "../externals/freetype/src/truetype/truetype.c", + ] + } +} else { + config("system_freetype2") { + include_dirs = [ "/usr/include/freetype2" ] + libs = [ "freetype" ] + } + group("freetype2") { + public_configs = [ ":system_freetype2" ] + } +} diff --git a/third_party/icu/BUILD.gn b/third_party/icu/BUILD.gn index e2137609d8..e7a55b5218 100644 --- a/third_party/icu/BUILD.gn +++ b/third_party/icu/BUILD.gn @@ -199,9 +199,5 @@ third_party("icu") { "../externals/icu/source/common/uvectr64.cpp", "../externals/icu/source/common/wintz.c", ] - if (is_linux) { - sources += [ "../externals/icu/linux/icudtl_dat.S" ] - } else if (is_mac) { - sources += [ "../externals/icu/mac/icudtl_dat.S" ] - } + sources += [ "../externals/icu/$current_os/icudtl_dat.S" ] } diff --git a/third_party/libpng/BUILD.gn b/third_party/libpng/BUILD.gn index 76c00277b6..5cd865529e 100644 --- a/third_party/libpng/BUILD.gn +++ b/third_party/libpng/BUILD.gn @@ -31,4 +31,11 @@ third_party("libpng") { "pngwtran.c", "pngwutil.c", ] + + if (current_cpu == "arm" || current_cpu == "arm64") { + sources += [ + "arm/arm_init.c", + "arm/filter_neon_intrinsics.c", + ] + } } diff --git a/third_party/libwebp/BUILD.gn b/third_party/libwebp/BUILD.gn index efac7d2e09..7f7901e754 100644 --- a/third_party/libwebp/BUILD.gn +++ b/third_party/libwebp/BUILD.gn @@ -41,22 +41,28 @@ third_party("libwebp") { "../externals/libwebp/src/dsp/cpu.c", "../externals/libwebp/src/dsp/dec.c", "../externals/libwebp/src/dsp/dec_clip_tables.c", + "../externals/libwebp/src/dsp/dec_neon.c", "../externals/libwebp/src/dsp/dec_sse2.c", "../externals/libwebp/src/dsp/dec_sse41.c", "../externals/libwebp/src/dsp/enc.c", "../externals/libwebp/src/dsp/enc_avx2.c", + "../externals/libwebp/src/dsp/enc_neon.c", "../externals/libwebp/src/dsp/enc_sse2.c", "../externals/libwebp/src/dsp/enc_sse41.c", "../externals/libwebp/src/dsp/filters.c", "../externals/libwebp/src/dsp/filters_sse2.c", "../externals/libwebp/src/dsp/lossless.c", "../externals/libwebp/src/dsp/lossless_enc.c", + "../externals/libwebp/src/dsp/lossless_enc_neon.c", "../externals/libwebp/src/dsp/lossless_enc_sse2.c", "../externals/libwebp/src/dsp/lossless_enc_sse41.c", + "../externals/libwebp/src/dsp/lossless_neon.c", "../externals/libwebp/src/dsp/lossless_sse2.c", "../externals/libwebp/src/dsp/rescaler.c", + "../externals/libwebp/src/dsp/rescaler_neon.c", "../externals/libwebp/src/dsp/rescaler_sse2.c", "../externals/libwebp/src/dsp/upsampling.c", + "../externals/libwebp/src/dsp/upsampling_neon.c", "../externals/libwebp/src/dsp/upsampling_sse2.c", "../externals/libwebp/src/dsp/yuv.c", "../externals/libwebp/src/dsp/yuv_sse2.c", diff --git a/third_party/sfntly/BUILD.gn b/third_party/sfntly/BUILD.gn index a9bf925fb2..845c6ed198 100644 --- a/third_party/sfntly/BUILD.gn +++ b/third_party/sfntly/BUILD.gn @@ -14,7 +14,6 @@ third_party("sfntly") { deps = [ "//third_party/icu", ] - libs = [ "pthread" ] sources = [ "../externals/sfntly/cpp/src/sample/chromium/font_subsetter.cc", "../externals/sfntly/cpp/src/sample/chromium/subsetter_impl.cc", |