blob: 6cd6a048abac7567fedc1f52a0e016c44fc891db [file] [log] [blame]
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +00001# Copyright 2014 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6{
7 'variables': {
8 'skia_warnings_as_errors': 0,
9 },
10 'targets': [
11 {
12 'target_name': 'libpng',
djsollenb2a6fe72015-04-03 12:35:27 -070013 'type': 'none',
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000014 'conditions': [
mtkleina5114d72015-08-24 13:27:01 -070015 [ 'skia_android_framework', {
16 'dependencies': [ 'android_deps.gyp:png' ],
17 'export_dependent_settings': [ 'android_deps.gyp:png' ],
18 },{
19 'dependencies': [ 'libpng.gyp:libpng_static' ],
20 'export_dependent_settings': [ 'libpng.gyp:libpng_static' ],
21 }]
djsollenb2a6fe72015-04-03 12:35:27 -070022 ]
23 },
24 {
25 'target_name': 'libpng_static',
26 'type': 'static_library',
27 'standalone_static_library': 1,
28 'include_dirs': [
29 # Needed for generated pnglibconf.h and pngprefix.h
30 '../third_party/libpng',
31 '../third_party/externals/libpng',
32 ],
33 'dependencies': [
34 'zlib.gyp:zlib',
35 ],
36 'export_dependent_settings': [
37 'zlib.gyp:zlib',
38 ],
39 'direct_dependent_settings': {
40 'include_dirs': [
41 '../third_party/externals/libpng',
42 # Needed for generated pnglibconf.h and pngprefix.h
43 '../third_party/libpng',
44 ],
djsollenb2a6fe72015-04-03 12:35:27 -070045 },
46 'cflags': [
47 '-w',
48 '-fvisibility=hidden',
49 ],
50 'sources': [
51 '../third_party/externals/libpng/png.c',
52 '../third_party/externals/libpng/pngerror.c',
53 '../third_party/externals/libpng/pngget.c',
54 '../third_party/externals/libpng/pngmem.c',
55 '../third_party/externals/libpng/pngpread.c',
56 '../third_party/externals/libpng/pngread.c',
57 '../third_party/externals/libpng/pngrio.c',
58 '../third_party/externals/libpng/pngrtran.c',
59 '../third_party/externals/libpng/pngrutil.c',
60 '../third_party/externals/libpng/pngset.c',
61 '../third_party/externals/libpng/pngtrans.c',
62 '../third_party/externals/libpng/pngwio.c',
63 '../third_party/externals/libpng/pngwrite.c',
64 '../third_party/externals/libpng/pngwtran.c',
65 '../third_party/externals/libpng/pngwutil.c',
66 ],
67 'conditions': [
msarett740668d2016-02-19 11:14:43 -080068 [ '"x86" in skia_arch_type', {
djsollenb2a6fe72015-04-03 12:35:27 -070069 'defines': [
msarett740668d2016-02-19 11:14:43 -080070 'PNG_INTEL_SSE_OPT=1',
djsollenb2a6fe72015-04-03 12:35:27 -070071 ],
msarett740668d2016-02-19 11:14:43 -080072 'sources': [
73 '../third_party/externals/libpng/contrib/intel/intel_init.c',
74 '../third_party/externals/libpng/contrib/intel/filter_sse2_intrinsics.c',
djsollenb2a6fe72015-04-03 12:35:27 -070075 ],
76 }],
msarett740668d2016-02-19 11:14:43 -080077 [ '(("arm64" == skia_arch_type) or \
78 ("arm" == skia_arch_type and arm_neon == 1)) and \
79 ("ios" != skia_os)', {
80 'defines': [
81 'PNG_ARM_NEON_OPT=2',
82 'PNG_ARM_NEON_IMPLEMENTATION=1',
83 ],
84 'sources': [
85 '../third_party/externals/libpng/arm/arm_init.c',
86 '../third_party/externals/libpng/arm/filter_neon_intrinsics.c',
87 ],
88 }],
89 [ '"ios" == skia_os', {
90 'defines': [
91 'PNG_ARM_NEON_OPT=0',
djsollenb2a6fe72015-04-03 12:35:27 -070092 ],
93 }],
94 ],
95 }
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000096 ]
97}