diff options
author | Mike Klein <mtklein@chromium.org> | 2017-07-31 11:57:21 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-31 18:39:23 +0000 |
commit | c722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8 (patch) | |
tree | f85d2595f5545e2f01d89cc1cf2a0d412cb0d5ea /third_party/libwebp | |
parent | d301629d1dad5da36d6f8225f17b92a3f36eaf2a (diff) |
clang on windows support
1) Run python bin/fetch-clang-win
2) Set clang_win = "../bin/clang_win"
3) ???
4) Profit
Most changes here are to pass the right -mfoo flags to Clang
to enable advanced instruction sets, or fixed warning-as-errors.
BUG=skia:2679
Change-Id: Ieed145d35c209131c7c16fdd3ee11a3de4a1a921
Reviewed-on: https://skia-review.googlesource.com/28740
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'third_party/libwebp')
-rw-r--r-- | third_party/libwebp/BUILD.gn | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/third_party/libwebp/BUILD.gn b/third_party/libwebp/BUILD.gn index 7fec982e35..4ac2c5ef5c 100644 --- a/third_party/libwebp/BUILD.gn +++ b/third_party/libwebp/BUILD.gn @@ -17,15 +17,7 @@ if (skia_use_system_libwebp) { ] } } else { - third_party("libwebp") { - public_include_dirs = [ "../externals/libwebp/src" ] - - if (is_android) { - deps = [ - "//third_party/cpu-features", - ] - } - + config("libwebp_defines") { defines = [ # WebP naturally decodes to RGB_565, and we work with BGR_565. # This makes WebP decode to BGR_565 when we ask for RGB_565. @@ -33,7 +25,49 @@ if (skia_use_system_libwebp) { # TODO: swizzle ourself in SkWebpCodec instead of requiring this non-standard libwebp. "WEBP_SWAP_16BIT_CSP", ] + } + + third_party("libwebp_sse41") { + public_include_dirs = [ "../externals/libwebp/src" ] + configs += [ ":libwebp_defines" ] + sources = [ + "../externals/libwebp/src/dsp/alpha_processing_sse41.c", + "../externals/libwebp/src/dsp/dec_sse41.c", + "../externals/libwebp/src/dsp/enc_sse41.c", + "../externals/libwebp/src/dsp/lossless_enc_sse41.c", + ] + if ((current_cpu == "x86" || current_cpu == "x64") && + (!is_win || is_clang)) { + cflags_c = ["-msse4.1"] + } + } + + third_party("libwebp_avx2") { + public_include_dirs = [ "../externals/libwebp/src" ] + configs += [ ":libwebp_defines" ] + sources = [ + "../externals/libwebp/src/dsp/enc_avx2.c", + ] + if ((current_cpu == "x86" || current_cpu == "x64") && + (!is_win || is_clang)) { + cflags_c = ["-mavx2"] + } + } + + third_party("libwebp") { + public_include_dirs = [ "../externals/libwebp/src" ] + + deps = [ + ":libwebp_sse41", + ":libwebp_avx2", + ] + if (is_android) { + deps += [ + "//third_party/cpu-features", + ] + } + configs += [ ":libwebp_defines" ] sources = [ "../externals/libwebp/src/dec/alpha_dec.c", "../externals/libwebp/src/dec/buffer_dec.c", @@ -50,7 +84,6 @@ if (skia_use_system_libwebp) { "../externals/libwebp/src/dsp/alpha_processing_mips_dsp_r2.c", "../externals/libwebp/src/dsp/alpha_processing_neon.c", "../externals/libwebp/src/dsp/alpha_processing_sse2.c", - "../externals/libwebp/src/dsp/alpha_processing_sse41.c", "../externals/libwebp/src/dsp/argb.c", "../externals/libwebp/src/dsp/argb_mips_dsp_r2.c", "../externals/libwebp/src/dsp/argb_sse2.c", @@ -65,15 +98,12 @@ if (skia_use_system_libwebp) { "../externals/libwebp/src/dsp/dec_mips_dsp_r2.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_mips32.c", "../externals/libwebp/src/dsp/enc_mips_dsp_r2.c", "../externals/libwebp/src/dsp/enc_msa.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_mips_dsp_r2.c", "../externals/libwebp/src/dsp/filters_msa.c", @@ -86,7 +116,6 @@ if (skia_use_system_libwebp) { "../externals/libwebp/src/dsp/lossless_enc_msa.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_mips_dsp_r2.c", "../externals/libwebp/src/dsp/lossless_msa.c", "../externals/libwebp/src/dsp/lossless_neon.c", |