Roll src/third_party/WebKit 8139f33:52503da (svn 201975:201976)
[chromium-blink-merge.git] / sdch / sdch.gyp
bloba184c88e490204e179e33cd562fa1ec83b3e41c9
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.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       'target_name': 'sdch',
12       'type': 'static_library',
13       'dependencies': [
14         '../base/base.gyp:base',
15         '../third_party/zlib/zlib.gyp:zlib',
16       ],
17       'sources': [
18         'logging_forward.h',
19         'open-vcdiff/src/addrcache.cc',
20         'open-vcdiff/src/blockhash.cc',
21         'open-vcdiff/src/blockhash.h',
22         'open-vcdiff/src/checksum.h',
23         'open-vcdiff/src/codetable.cc',
24         'open-vcdiff/src/codetable.h',
25         'open-vcdiff/src/compile_assert.h',
26         'open-vcdiff/src/decodetable.cc',
27         'open-vcdiff/src/decodetable.h',
28         'open-vcdiff/src/encodetable.cc',
29         'open-vcdiff/src/encodetable.h',
30         'open-vcdiff/src/google/output_string.h',
31         'open-vcdiff/src/google/vcdecoder.h',
32         'open-vcdiff/src/google/vcencoder.h',
33         'open-vcdiff/src/headerparser.cc',
34         'open-vcdiff/src/headerparser.h',
35         'open-vcdiff/src/instruction_map.cc',
36         'open-vcdiff/src/instruction_map.h',
37         'open-vcdiff/src/jsonwriter.h',
38         'open-vcdiff/src/jsonwriter.cc',
39         'open-vcdiff/src/rolling_hash.h',
40         'open-vcdiff/src/testing.h',
41         'open-vcdiff/src/varint_bigendian.cc',
42         'open-vcdiff/src/varint_bigendian.h',
43         'open-vcdiff/src/vcdecoder.cc',
44         'open-vcdiff/src/vcencoder.cc',
45         'open-vcdiff/src/vcdiff_defs.h',
46         'open-vcdiff/src/vcdiffengine.cc',
47         'open-vcdiff/src/vcdiffengine.h',
48         'open-vcdiff/vsprojects/config.h',
49         'open-vcdiff/vsprojects/stdint.h',
50       ],
51       'include_dirs': [
52         'open-vcdiff/src',
53       ],
54       'direct_dependent_settings': {
55         'include_dirs': [
56           'open-vcdiff/src',
57         ],
58       },
59       'conditions': [
60         [ 'OS == "linux" or OS == "android"', { 'include_dirs': [ 'linux' ] } ],
61         [ 'os_bsd==1 or OS=="solaris"', { 'include_dirs': [ 'bsd' ] } ],
62         [ 'OS == "ios"', { 'include_dirs': [ 'ios' ] } ],
63         [ 'OS == "mac"', {
64           'include_dirs': [ 'mac' ],
65           'defines': [ 'OPEN_VCDIFF_USE_AUTO_PTR' ],
66         }],
67         [ 'OS == "win"', { 'include_dirs': [ 'win' ] } ],
68       ],
69       # open-vcdiff's logging.h introduces static initializers. This was
70       # reported upstream years ago (
71       # https://github.com/google/open-vcdiff/issues/33 ). Since
72       # upstream won't fix this, work around it on the chromium side:
73       # Inject a header that forwards to base/logging.h instead (which doesn't
74       # introduce static initializers, and which prevents open-vcdiff's
75       # logging.h from being used).
76       'variables': {
77         'logging_path': 'logging_forward.h',
78         'conditions': [
79           # gyp leaves unspecified what the cwd is when running the compiler,
80           # and gyp/linux doesn't have a built-in way for forcing an include.
81           # So hardcode the base directory. If this spreads, provide native
82           # support in gyp, like we have for gyp/mac and gyp/windows.
83           # path.
84           ['"<(GENERATOR)"=="ninja"', { 'logging_dir': '../..' },
85                                       { 'logging_dir': '.' }
86           ],
87         ],
88       },
89       # GCC_PREFIX_HEADER is relative to the current directory,
90       # ForcedIncludeFiles is relative to include_dirs, cflags relative to the
91       # build directory.
92       'xcode_settings': { 'GCC_PREFIX_HEADER': '<(logging_path)' },
93       'msvs_settings': {
94         'VCCLCompilerTool': {
95           'ForcedIncludeFiles': [
96             'sdch/<(logging_path)',
97           ]
98         }
99       },
100       'cflags': [
101         '-include', '<(logging_dir)/sdch/<(logging_path)',
102         # TODO(mostynb): remove this if open-vcdiff is ever updated for c++11:
103         '-Wno-deprecated-declarations',
104       ],
105     },
106   ],