• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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      'type': 'none',
14      'conditions': [
15        [ '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        }]
22      ]
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        ],
45      },
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': [
68        [ '"x86" in skia_arch_type', {
69          'defines': [
70            'PNG_INTEL_SSE_OPT=1',
71          ],
72          'sources': [
73            '../third_party/externals/libpng/contrib/intel/intel_init.c',
74            '../third_party/externals/libpng/contrib/intel/filter_sse2_intrinsics.c',
75          ],
76        }],
77        [ '(("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',
92          ],
93        }],
94      ],
95    }
96  ]
97}
98