zlib.gyp revision c2e0dbddbe15c98d52c4786dac06cb8952a8ae6d
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
3# found in the LICENSE file.
4
5{
6  'targets': [
7    {
8      'target_name': 'zlib',
9      'type': 'static_library',
10      'sources': [
11        'adler32.c',
12        'compress.c',
13        'crc32.c',
14        'crc32.h',
15        'deflate.c',
16        'deflate.h',
17        'gzclose.c',
18        'gzguts.h',
19        'gzlib.c',
20        'gzread.c',
21        'gzwrite.c',
22        'infback.c',
23        'inffast.c',
24        'inffast.h',
25        'inffixed.h',
26        'inflate.c',
27        'inflate.h',
28        'inftrees.c',
29        'inftrees.h',
30        'mozzconf.h',
31        'trees.c',
32        'trees.h',
33        'uncompr.c',
34        'zconf.h',
35        'zlib.h',
36        'zutil.c',
37        'zutil.h',
38      ],
39      'include_dirs': [
40        '.',
41      ],
42      'direct_dependent_settings': {
43        'include_dirs': [
44          '.',
45        ],
46      },
47      'conditions': [
48        ['OS!="win"', {
49          'product_name': 'chrome_zlib',
50        }], ['OS=="android"', {
51          'toolsets': ['target', 'host'],
52        }],
53      ],
54    },
55    {
56      'target_name': 'minizip',
57      'type': 'static_library',
58      'sources': [
59        'contrib/minizip/ioapi.c',
60        'contrib/minizip/ioapi.h',
61        'contrib/minizip/iowin32.c',
62        'contrib/minizip/iowin32.h',
63        'contrib/minizip/unzip.c',
64        'contrib/minizip/unzip.h',
65        'contrib/minizip/zip.c',
66        'contrib/minizip/zip.h',
67      ],
68      'dependencies': [
69        'zlib',
70      ],
71      'include_dirs': [
72        '.',
73        '../..',
74      ],
75      'direct_dependent_settings': {
76        'include_dirs': [
77          '.',
78        ],
79      },
80      'conditions': [
81        ['OS!="win"', {
82          'sources!': [
83            'contrib/minizip/iowin32.c'
84          ],
85        }],
86        ['OS=="android"', {
87          'toolsets': ['target', 'host'],
88        }],
89        ['OS=="mac" or OS=="ios" or os_bsd==1 or OS=="android"', {
90          # Mac, Android and the BSDs don't have fopen64, ftello64, or
91          # fseeko64. We use fopen, ftell, and fseek instead on these
92          # systems.
93          'defines': [
94            'USE_FILE32API'
95          ],
96        }],
97        ['clang==1', {
98          'xcode_settings': {
99            'WARNING_CFLAGS': [
100              # zlib uses `if ((a == b))` for some reason.
101              '-Wno-parentheses-equality',
102            ],
103          },
104          'cflags': [
105            '-Wno-parentheses-equality',
106          ],
107        }],
108      ],
109    },
110    {
111      'target_name': 'zip',
112      'type': 'static_library',
113      'dependencies': [
114        'minizip',
115        '../../base/base.gyp:base',
116      ],
117      'include_dirs': [
118        '../..',
119      ],
120      'sources': [
121        'google/zip.cc',
122        'google/zip.h',
123        'google/zip_internal.cc',
124        'google/zip_internal.h',
125        'google/zip_reader.cc',
126        'google/zip_reader.h',
127      ],
128    },
129  ],
130}
131