Index: third_party/libpng/BUILD.gn |
diff --git a/third_party/libpng/BUILD.gn b/third_party/libpng/BUILD.gn |
index 365c4558000df86c36ba7e1678bcb38fb89c2021..96d94e6130c0cf9aa8098f4d7b66df2c3c5eeb02 100644 |
--- a/third_party/libpng/BUILD.gn |
+++ b/third_party/libpng/BUILD.gn |
@@ -7,14 +7,10 @@ import("//build/config/chromecast_build.gni") |
config("libpng_config") { |
include_dirs = [ "." ] |
- defines = [ |
- "CHROME_PNG_WRITE_SUPPORT", |
- "PNG_USER_CONFIG", |
- ] |
+ defines = [] |
if (is_android || is_chromecast) { |
- #'toolsets': ['target', 'host'], |
- defines += [ "CHROME_PNG_READ_PACK_SUPPORT" ] # Required by freetype. |
+ #"toolsets": ["target", "host"], |
Nico
2016/06/03 20:27:44
remove this if, it doesn't do anything
msarett
2016/06/03 21:26:01
SGTM
|
} |
if (is_win) { |
@@ -32,17 +28,17 @@ config("libpng_config") { |
config("clang_warnings") { |
if (is_clang) { |
# Upstream uses self-assignment to avoid warnings. |
Nico
2016/06/03 20:27:44
do we still need -Wno-self-assign then?
msarett
2016/06/03 21:26:01
Removing it. The bots should tell us, I think.
msarett
2016/06/06 14:18:15
Looks like we are fine without this, thanks :).
|
- cflags = [ "-Wno-self-assign" ] |
+ cflags = [ |
+ "-Wno-self-assign", |
+ "-Wno-tautological-constant-out-of-range-compare", |
Nico
2016/06/03 20:27:44
is there an upstream bug for this?
msarett
2016/06/03 21:26:01
libpng checks that the width (uint32_t) is not gr
|
+ ] |
} |
} |
source_set("libpng_sources") { |
sources = [ |
"png.c", |
- "png.h", |
Nico
2016/06/03 20:27:44
what happened to png.h?
msarett
2016/06/03 21:26:01
I'll put it back. Is it typical to list *.h files
Nico
2016/06/03 21:36:49
Yes, normally we list them. (Since nothing checks
msarett
2016/06/06 14:18:15
Acknowledged.
|
- "pngconf.h", |
"pngerror.c", |
- "pnggccrd.c", |
"pngget.c", |
"pngmem.c", |
"pngpread.c", |
@@ -52,19 +48,36 @@ source_set("libpng_sources") { |
"pngrutil.c", |
"pngset.c", |
"pngtrans.c", |
- "pngusr.h", |
- "pngvcrd.c", |
"pngwio.c", |
"pngwrite.c", |
"pngwtran.c", |
"pngwutil.c", |
] |
+ defines = [] |
+ |
+ if (current_cpu == "x86" || current_cpu == "x64") { |
+ sources += [ |
+ "contrib/intel/filter_sse2_intrinsics.c", |
+ "contrib/intel/intel_init.c", |
+ ] |
+ defines += [ "PNG_INTEL_SSE_OPT=1" ] |
+ } else if (current_cpu == "arm" || current_cpu == "arm64") { |
+ sources += [ |
+ "arm/arm_init.c", |
+ "arm/filter_neon_intrinsics.c", |
+ ] |
+ defines += [ |
+ "PNG_ARM_NEON_OPT=2", |
+ "PNG_ARM_NEON_IMPLEMENTATION=1", |
+ ] |
+ } |
+ |
configs -= [ "//build/config/compiler:chromium_code" ] |
configs += [ "//build/config/compiler:no_chromium_code" ] |
if (is_win && is_component_build) { |
- defines = [ "PNG_BUILD_DLL" ] |
+ defines += [ "PNG_BUILD_DLL" ] |
} |
public_configs = [ ":libpng_config" ] |