blob: 1ca6eef25343498577152b422f2c8ebf48c4c573 [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',
13 'conditions': [
14 [ 'skia_libpng_static',
15 {
16 'type': 'static_library',
17 'include_dirs': [
18 '../third_party/externals/libpng',
scroggof24f2242015-03-03 08:59:20 -080019 # Needed for generated pnglibconf.h
20 '../third_party/libpng',
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000021 ],
22 'dependencies': [
23 'zlib.gyp:zlib',
24 ],
25 'export_dependent_settings': [
26 'zlib.gyp:zlib',
27 ],
28 'direct_dependent_settings': {
29 'include_dirs': [
30 '../third_party/externals/libpng',
scroggof24f2242015-03-03 08:59:20 -080031 # Needed for generated pnglibconf.h
32 '../third_party/libpng',
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000033 ],
34 },
35 'cflags': [
36 '-w',
37 '-fvisibility=hidden',
38 ],
scroggof24f2242015-03-03 08:59:20 -080039 'conditions': [
40 ['not arm_neon', {
41 'defines': [
42 # FIXME: Why is this needed? Without it, pngpriv.h sets it
43 # to 2 if __ARM_NEON is defined, but shouldn't __ARM_NEON
44 # not be defined since arm_neon is 0?
45 'PNG_ARM_NEON_OPT=0',
46 ],
47 }],
48 ],
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000049 'sources': [
50 '../third_party/externals/libpng/png.c',
51 '../third_party/externals/libpng/pngerror.c',
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000052 '../third_party/externals/libpng/pngget.c',
53 '../third_party/externals/libpng/pngmem.c',
54 '../third_party/externals/libpng/pngpread.c',
55 '../third_party/externals/libpng/pngread.c',
56 '../third_party/externals/libpng/pngrio.c',
57 '../third_party/externals/libpng/pngrtran.c',
58 '../third_party/externals/libpng/pngrutil.c',
59 '../third_party/externals/libpng/pngset.c',
60 '../third_party/externals/libpng/pngtrans.c',
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000061 '../third_party/externals/libpng/pngwio.c',
62 '../third_party/externals/libpng/pngwrite.c',
63 '../third_party/externals/libpng/pngwtran.c',
64 '../third_party/externals/libpng/pngwutil.c',
65 ],
66 }, { # not skia_libpng_static
67 'type': 'none',
68 'conditions': [
69 [ 'skia_os == "android"',
70 {
71 # TODO(halcanary): merge all png targets into this file.
72 'dependencies': [
73 'android_deps.gyp:png',
74 ],
75 'export_dependent_settings': [
76 'android_deps.gyp:png',
77 ],
78 }, { # skia_os != "android"
79 'dependencies': [
80 'zlib.gyp:zlib',
81 ],
82 'export_dependent_settings': [
83 'zlib.gyp:zlib',
84 ],
85 'direct_dependent_settings': {
86 'link_settings': {
87 'libraries': [
88 '-lpng',
89 ],
90 },
91 },
92 }
93 ]
94 ]
95 }
96 ]
97 ],
98 },
99 ]
100}