[email protected] | 17bc098 | 2012-04-04 03:26:07 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 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 | 'variables': { |
| 7 | 'chromium_code': 1, |
| 8 | }, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 9 | 'targets': [ |
| 10 | { |
| 11 | 'target_name': 'sdch', |
[email protected] | 5a54733 | 2011-05-19 23:18:53 | [diff] [blame] | 12 | 'type': 'static_library', |
[email protected] | 17bc098 | 2012-04-04 03:26:07 | [diff] [blame] | 13 | 'dependencies': [ |
[email protected] | 6cbc3051 | 2013-11-13 04:11:49 | [diff] [blame] | 14 | '../base/base.gyp:base', |
[email protected] | 17bc098 | 2012-04-04 03:26:07 | [diff] [blame] | 15 | '../third_party/zlib/zlib.gyp:zlib', |
| 16 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 17 | 'sources': [ |
[email protected] | 6cbc3051 | 2013-11-13 04:11:49 | [diff] [blame] | 18 | 'logging_forward.h', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 19 | 'open-vcdiff/src/addrcache.cc', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 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', |
[email protected] | 33acd5b | 2014-08-19 19:56:22 | [diff] [blame] | 32 | 'open-vcdiff/src/google/vcencoder.h', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 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', |
[email protected] | 33acd5b | 2014-08-19 19:56:22 | [diff] [blame] | 37 | 'open-vcdiff/src/jsonwriter.h', |
| 38 | 'open-vcdiff/src/jsonwriter.cc', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 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', |
[email protected] | 33acd5b | 2014-08-19 19:56:22 | [diff] [blame] | 44 | 'open-vcdiff/src/vcencoder.cc', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 45 | 'open-vcdiff/src/vcdiff_defs.h', |
| 46 | 'open-vcdiff/src/vcdiffengine.cc', |
| 47 | 'open-vcdiff/src/vcdiffengine.h', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 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': [ |
[email protected] | dc51052 | 2011-09-07 08:44:56 | [diff] [blame] | 60 | [ 'OS == "linux" or OS == "android"', { 'include_dirs': [ 'linux' ] } ], |
[email protected] | c48aef9 | 2011-11-22 23:41:45 | [diff] [blame] | 61 | [ 'os_bsd==1 or OS=="solaris"', { 'include_dirs': [ 'bsd' ] } ], |
[email protected] | 91c1769 | 2012-07-25 16:20:41 | [diff] [blame] | 62 | [ 'OS == "ios"', { 'include_dirs': [ 'ios' ] } ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 63 | [ 'OS == "mac"', { 'include_dirs': [ 'mac' ] } ], |
[email protected] | 3ddcee7 | 2014-01-07 17:50:58 | [diff] [blame] | 64 | [ 'OS == "win"', { 'include_dirs': [ 'win' ] } ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 65 | ], |
[email protected] | 6cbc3051 | 2013-11-13 04:11:49 | [diff] [blame] | 66 | # open-vcdiff's logging.h introduces static initializers. This was |
| 67 | # reported upstream years ago ( |
| 68 | # https://code.google.com/p/open-vcdiff/issues/detail?id=33 ). Since |
| 69 | # upstream won't fix this, work around it on the chromium side: |
| 70 | # Inject a header that forwards to base/logging.h instead (which doesn't |
| 71 | # introduce static initializers, and which prevents open-vcdiff's |
| 72 | # logging.h from being used). |
| 73 | 'variables': { |
thakis | 4970b58 | 2014-11-12 20:53:32 | [diff] [blame] | 74 | 'clang_warning_flags': [ |
| 75 | # sdch uses the pre-c++11 typedef-as-static_assert hack. |
| 76 | # https://code.google.com/p/open-vcdiff/issues/detail?id=44 |
| 77 | '-Wno-unused-local-typedef', |
| 78 | ], |
[email protected] | 6cbc3051 | 2013-11-13 04:11:49 | [diff] [blame] | 79 | 'logging_path': 'logging_forward.h', |
| 80 | 'conditions': [ |
| 81 | # gyp leaves unspecified what the cwd is when running the compiler, |
| 82 | # and gyp/linux doesn't have a built-in way for forcing an include. |
| 83 | # So hardcode the base directory. If this spreads, provide native |
| 84 | # support in gyp, like we have for gyp/mac and gyp/windows. |
| 85 | # path. |
| 86 | ['"<(GENERATOR)"=="ninja"', { 'logging_dir': '../..' }, |
| 87 | { 'logging_dir': '.' } |
| 88 | ], |
| 89 | ], |
| 90 | }, |
| 91 | # GCC_PREFIX_HEADER is relative to the current directory, |
| 92 | # ForcedIncludeFiles is relative to include_dirs, cflags relative to the |
| 93 | # build directory. |
| 94 | 'xcode_settings': { 'GCC_PREFIX_HEADER': '<(logging_path)' }, |
| 95 | 'msvs_settings': { |
[email protected] | bcf30dae | 2014-01-13 07:00:00 | [diff] [blame] | 96 | 'VCCLCompilerTool': { |
| 97 | 'ForcedIncludeFiles': [ |
[email protected] | bcf30dae | 2014-01-13 07:00:00 | [diff] [blame] | 98 | 'sdch/<(logging_path)', |
| 99 | ] |
| 100 | } |
[email protected] | 6cbc3051 | 2013-11-13 04:11:49 | [diff] [blame] | 101 | }, |
[email protected] | 9cfa983 | 2014-03-24 13:06:53 | [diff] [blame] | 102 | 'cflags': [ |
| 103 | '-include', '<(logging_dir)/sdch/<(logging_path)', |
| 104 | # TODO(mostynb): remove this if open-vcdiff is ever updated for c++11: |
| 105 | '-Wno-deprecated-declarations', |
| 106 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 107 | }, |
| 108 | ], |
| 109 | } |