Chromium Code Reviews| Index: third_party/zlib/BUILD.gn |
| diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn |
| index 0f21450e38bc65c62cbe1fccf0d5e884206370b3..84cc1eb0d6aa2b386bffdf3d69516a4ce0dfb918 100644 |
| --- a/third_party/zlib/BUILD.gn |
| +++ b/third_party/zlib/BUILD.gn |
| @@ -4,6 +4,18 @@ |
| config("zlib_config") { |
| include_dirs = [ "." ] |
| + if (cpu_arch == "x86" || cpu_arch == "x64") { |
| + defines = [ "ZLIB_X86_SIMD" ] |
|
agl
2014/10/17 00:45:34
ditto about not adding a #define.
robert.bradford
2014/10/20 16:45:54
Acknowledged.
|
| + } |
| +} |
| + |
| +static_library("zlib_x86_simd") { |
| + if (cpu_arch == "x86" || cpu_arch == "x64") { |
| + sources = [ "crc_folding.c", "fill_window_sse.c" ] |
| + cflags = [ "-msse2", "-msse4.2", "-mpclmul" ] |
| + } else { |
| + sources = [ "simd_stub.c"] |
| + } |
| } |
| static_library("zlib") { |
| @@ -36,16 +48,22 @@ static_library("zlib") { |
| "trees.c", |
| "trees.h", |
| "uncompr.c", |
| + "x86.h", |
| "zconf.h", |
| "zlib.h", |
| "zutil.c", |
| "zutil.h", |
| ] |
| + if (cpu_arch == "x86" || cpu_arch == "x64") { |
| + sources += [ "x86.c" ] |
| + } |
| + |
| configs -= [ "//build/config/compiler:chromium_code" ] |
| configs += [ "//build/config/compiler:no_chromium_code" ] |
| public_configs = [ ":zlib_config" ] |
| + deps = [ ":zlib_x86_simd" ] |
| } |
| static_library("minizip") { |