OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'targets': [ | 6 'targets': [ |
7 { | 7 { |
8 'target_name': 'libpng', | 8 'target_name': 'libpng', |
9 'dependencies': [ | 9 'dependencies': [ |
10 '../zlib/zlib.gyp:zlib', | 10 '../zlib/zlib.gyp:zlib', |
11 ], | 11 ], |
12 'variables': { | |
13 # Upstream uses self-assignment to avoid warnings. | |
14 'clang_warning_flags': [ '-Wno-self-assign' ] | |
15 }, | |
16 'defines': [ | |
17 'CHROME_PNG_WRITE_SUPPORT', | |
18 'PNG_USER_CONFIG', | |
19 ], | |
20 'sources': [ | 12 'sources': [ |
21 'png.c', | 13 'png.c', |
22 'png.h', | 14 'png.h', |
23 'pngconf.h', | |
24 'pngerror.c', | 15 'pngerror.c', |
25 'pnggccrd.c', | |
26 'pngget.c', | 16 'pngget.c', |
| 17 'pnglibconf.h', |
27 'pngmem.c', | 18 'pngmem.c', |
28 'pngpread.c', | 19 'pngpread.c', |
| 20 'pngprefix.h', |
29 'pngread.c', | 21 'pngread.c', |
30 'pngrio.c', | 22 'pngrio.c', |
31 'pngrtran.c', | 23 'pngrtran.c', |
32 'pngrutil.c', | 24 'pngrutil.c', |
33 'pngset.c', | 25 'pngset.c', |
34 'pngtrans.c', | 26 'pngtrans.c', |
35 'pngusr.h', | |
36 'pngvcrd.c', | |
37 'pngwio.c', | 27 'pngwio.c', |
38 'pngwrite.c', | 28 'pngwrite.c', |
39 'pngwtran.c', | 29 'pngwtran.c', |
40 'pngwutil.c', | 30 'pngwutil.c', |
41 ], | 31 ], |
42 'direct_dependent_settings': { | 32 'direct_dependent_settings': { |
43 'include_dirs': [ | 33 'include_dirs': [ |
44 '.', | 34 '.', |
45 ], | 35 ], |
46 'defines': [ | |
47 'CHROME_PNG_WRITE_SUPPORT', | |
48 'PNG_USER_CONFIG', | |
49 ], | |
50 }, | 36 }, |
51 'export_dependent_settings': [ | 37 'export_dependent_settings': [ |
52 '../zlib/zlib.gyp:zlib', | 38 '../zlib/zlib.gyp:zlib', |
53 ], | 39 ], |
54 # TODO(jschuh): http://crbug.com/167187 | 40 # TODO(jschuh): http://crbug.com/167187 |
55 'msvs_disabled_warnings': [ 4267 ], | 41 'msvs_disabled_warnings': [ 4267 ], |
56 'conditions': [ | 42 'conditions': [ |
| 43 # Disable ARM optimizations on IOS. Can't find a way to get gyp to even
try |
| 44 # to compile the optimization files. This works fine on GN. |
| 45 [ 'OS=="ios"', { |
| 46 'defines': [ |
| 47 'PNG_ARM_NEON_OPT=0', |
| 48 ], |
| 49 }], |
| 50 |
| 51 # SSE optimizations |
| 52 [ 'target_arch=="ia32" or target_arch=="x64"', { |
| 53 'defines': [ |
| 54 'PNG_INTEL_SSE_OPT=1', |
| 55 ], |
| 56 'sources': [ |
| 57 'contrib/intel/intel_init.c', |
| 58 'contrib/intel/filter_sse2_intrinsics.c', |
| 59 ], |
| 60 }], |
| 61 |
| 62 # ARM optimizations |
| 63 [ 'target_arch=="arm" or target_arch=="arm64" and OS!="ios"', { |
| 64 'defines': [ |
| 65 'PNG_ARM_NEON_OPT=2', |
| 66 'PNG_ARM_NEON_IMPLEMENTATION=1', |
| 67 ], |
| 68 'sources': [ |
| 69 'arm/arm_init.c', |
| 70 'arm/filter_neon_intrinsics.c', |
| 71 ], |
| 72 }], |
| 73 |
57 ['OS!="win"', {'product_name': 'png'}], | 74 ['OS!="win"', {'product_name': 'png'}], |
58 ['OS=="win"', { | 75 ['OS=="win"', { |
59 'type': '<(component)', | 76 'type': '<(component)', |
60 }, { | 77 }, { |
61 # Chromium libpng does not support building as a shared_library | 78 # Chromium libpng does not support building as a shared_library |
62 # on non-Windows platforms. | 79 # on non-Windows platforms. |
63 'type': 'static_library', | 80 'type': 'static_library', |
64 }], | 81 }], |
65 ['OS=="win" and component=="shared_library"', { | 82 ['OS=="win" and component=="shared_library"', { |
66 'defines': [ | 83 'defines': [ |
67 'PNG_BUILD_DLL', | 84 'PNG_BUILD_DLL', |
68 'PNG_NO_MODULEDEF', | 85 'PNG_NO_MODULEDEF', |
69 ], | 86 ], |
70 'direct_dependent_settings': { | 87 'direct_dependent_settings': { |
71 'defines': [ | 88 'defines': [ |
72 'PNG_USE_DLL', | 89 'PNG_USE_DLL', |
73 ], | 90 ], |
74 }, | 91 }, |
75 }], | 92 }], |
76 ['OS=="android" or chromecast==1', { | 93 ['OS=="android"', { |
77 'conditions': [ | 94 'toolsets': ['target', 'host'], |
78 ['OS=="android"', { | |
79 'toolsets': ['target', 'host'], | |
80 }], | |
81 ], | |
82 'defines': [ | |
83 'CHROME_PNG_READ_PACK_SUPPORT', # Required by freetype. | |
84 ], | |
85 'direct_dependent_settings': { | |
86 'defines': [ | |
87 'CHROME_PNG_READ_PACK_SUPPORT', | |
88 ], | |
89 }, | |
90 }], | 95 }], |
91 ], | 96 ], |
92 }, | 97 }, |
93 ] | 98 ] |
94 } | 99 } |
OLD | NEW |