blob: 45be5f7180ded5c363694af89d928c0ebb66d186 [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_os == "android"', {
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 }]
22 ]
23 },
24 {
25 'target_name': 'libpng_static_when_possible',
26 'type': 'none',
27 'conditions': [
28 [ 'skia_android_framework', {
29 'dependencies': [ 'android_deps.gyp:png' ],
30 'export_dependent_settings': [ 'android_deps.gyp:png' ],
31 },{
32 'dependencies': [ 'libpng.gyp:libpng_static' ],
33 'export_dependent_settings': [ 'libpng.gyp:libpng_static' ],
34 }]
djsollenb2a6fe72015-04-03 12:35:27 -070035 ]
36 },
37 {
38 'target_name': 'libpng_static',
39 'type': 'static_library',
40 'standalone_static_library': 1,
41 'include_dirs': [
42 # Needed for generated pnglibconf.h and pngprefix.h
43 '../third_party/libpng',
44 '../third_party/externals/libpng',
45 ],
46 'dependencies': [
47 'zlib.gyp:zlib',
48 ],
49 'export_dependent_settings': [
50 'zlib.gyp:zlib',
51 ],
52 'direct_dependent_settings': {
53 'include_dirs': [
54 '../third_party/externals/libpng',
55 # Needed for generated pnglibconf.h and pngprefix.h
56 '../third_party/libpng',
57 ],
58 'defines': [
59 'SKIA_PNG_PREFIXED',
60 ],
61 },
62 'cflags': [
63 '-w',
64 '-fvisibility=hidden',
65 ],
66 'sources': [
67 '../third_party/externals/libpng/png.c',
68 '../third_party/externals/libpng/pngerror.c',
69 '../third_party/externals/libpng/pngget.c',
70 '../third_party/externals/libpng/pngmem.c',
71 '../third_party/externals/libpng/pngpread.c',
72 '../third_party/externals/libpng/pngread.c',
73 '../third_party/externals/libpng/pngrio.c',
74 '../third_party/externals/libpng/pngrtran.c',
75 '../third_party/externals/libpng/pngrutil.c',
76 '../third_party/externals/libpng/pngset.c',
77 '../third_party/externals/libpng/pngtrans.c',
78 '../third_party/externals/libpng/pngwio.c',
79 '../third_party/externals/libpng/pngwrite.c',
80 '../third_party/externals/libpng/pngwtran.c',
81 '../third_party/externals/libpng/pngwutil.c',
82 ],
83 'conditions': [
84 [ 'skia_os == "ios"', {
85 # explicitly disable looking for NEON on iOS builds
86 'defines': [
87 'PNG_ARM_NEON_OPT=0',
88 ],
mtkleina5114d72015-08-24 13:27:01 -070089 }, { # skia_os != "ios"
djsollenb2a6fe72015-04-03 12:35:27 -070090 'dependencies': [
91 'libpng.gyp:libpng_static_neon',
92 ],
93 }],
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000094 ],
95 },
djsollenb2a6fe72015-04-03 12:35:27 -070096 {
97 'target_name': 'libpng_static_neon',
98 'type': 'static_library',
99 'include_dirs': [
100 # Needed for generated pnglibconf.h and pngprefix.h
101 '../third_party/libpng',
102 '../third_party/externals/libpng',
103 ],
104 'dependencies': [
105 'zlib.gyp:zlib',
106 ],
107 'sources': [
108 '../third_party/externals/libpng/arm/arm_init.c',
109 '../third_party/externals/libpng/arm/filter_neon.S',
110 '../third_party/externals/libpng/arm/filter_neon_intrinsics.c',
111 ],
112 'conditions': [
113 ['arm_neon_optional', {
114 'cflags': [
115 '-mfpu=neon',
116 ],
117 }],
118 ],
119 }
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +0000120 ]
121}