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 'variables': { 7 'conditions': [ 8 # Define an "os_include" variable that points at the OS-specific generated 9 # headers. These were generated by running the configure script offline. 10 ['os_posix == 1 and OS != "mac"', { 11 'os_include': 'linux' 12 }], 13 ['OS=="mac"', {'os_include': 'mac'}], 14 ['OS=="win"', {'os_include': 'win32'}], 15 ], 16 'use_system_libxml%': 0, 17 }, 18 'targets': [ 19 { 20 'target_name': 'snappy', 21 'type': 'static_library', 22 'include_dirs': [ 23 '<(os_include)', 24 'src', 25 '../..', 26 ], 27 'direct_dependent_settings': { 28 'include_dirs': [ 29 '<(os_include)', 30 'src', 31 ], 32 }, 33 'sources': [ 34 'src/snappy-internal.h', 35 'src/snappy-sinksource.cc', 36 'src/snappy-sinksource.h', 37 'src/snappy-stubs-internal.cc', 38 'src/snappy-stubs-internal.h', 39 'src/snappy.cc', 40 'src/snappy.h', 41 ], 42 'conditions': [ 43 ['clang == 1', { 44 # snappy-stubs-internal.h unapologetically has: using namespace std 45 # https://code.google.com/p/snappy/issues/detail?id=70 46 'xcode_settings': { 47 'WARNING_CFLAGS!': [ '-Wheader-hygiene' ], 48 }, 49 'cflags': [ '-Wno-header-hygiene' ], 50 }], 51 ['OS=="linux"', { 52 'defines': [ 53 # TODO(tfarina): Only Linux has the generated config.h for now. 54 # Generate the config.h in the other platforms: mac, win and enable 55 # this for everyone. 56 'HAVE_CONFIG_H=1', 57 ], 58 }], 59 ['OS=="win"', { 60 # Signed/unsigned comparison 61 'msvs_disabled_warnings': [ 62 # https://code.google.com/p/snappy/issues/detail?id=71 63 4018, 64 # https://code.google.com/p/snappy/issues/detail?id=75 65 4267, 66 ], 67 }], 68 ], 69 }, 70 { 71 'target_name': 'snappy_unittest', 72 'type': 'executable', 73 'defines': [ 74 'HAVE_CONFIG_H=1', 75 ], 76 'sources': [ 77 'src/snappy-test.cc', 78 'src/snappy-test.h', 79 'src/snappy_unittest.cc', 80 ], 81 'dependencies': [ 82 'snappy', 83 '../../base/base.gyp:base', 84 '../../testing/gtest.gyp:gtest', 85 '../../third_party/zlib/zlib.gyp:zlib', 86 ], 87 'conditions': [ 88 ['clang == 1', { 89 'cflags': [ 90 '-Wno-return-type', 91 '-Wno-header-hygiene' 92 ], 93 }], 94 ], 95 }, 96 ], 97 } 98