Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / zlib / BUILD.gn
index 0f21450..18cf816 100644 (file)
@@ -6,6 +6,15 @@ config("zlib_config") {
   include_dirs = [ "." ]
 }
 
+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") {
   if (!is_win) {
     # Don't stomp on "libzlib" on other platforms.
@@ -36,16 +45,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") {