summaryrefslogtreecommitdiffstats
path: root/tools/gn/secondary/third_party/snappy/BUILD.gn
blob: 578b455af96fd883d8514cf29d4a30a221ad3187 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

config("snappy_config") {
  includes = [
    "src",
  ]

  # These OS-specific generated headers were made by running the configure
  # script offline.
  if (is_win) {
    includes += "win32"
  } else if (is_mac) {
    includes += "mac"
  } else {
    includes += "linux"
  }
}

static_library("snappy") {
  sources = [
    "src/snappy-internal.h",
    "src/snappy-sinksource.cc",
    "src/snappy-sinksource.h",
    "src/snappy-stubs-internal.cc",
    "src/snappy-stubs-internal.h",
    "src/snappy.cc",
    "src/snappy.h",
  ]

  configs -= "//build/config/compiler:chromium_code"
  configs += "//build/config/compiler:no_chromium_code"
  direct_dependent_configs = [ ":snappy_config" ]

  #['OS=="win"', {
  #          # Signed/unsigned comparison
  #          'msvs_disabled_warnings': [
  #            # https://code.google.com/p/snappy/issues/detail?id=71
  #            4018,
  #            # https://code.google.com/p/snappy/issues/detail?id=75
  #            4267,
  #          ],
  #        }],
  #      ['clang == 1', {
  #          # snappy-stubs-internal.h unapologetically has: using namespace std
  #          # https://code.google.com/p/snappy/issues/detail?id=70
  #          'xcode_settings': {
  #            'WARNING_CFLAGS!': [ '-Wheader-hygiene' ],
  #          },
  #          'cflags!': [ '-Wheader-hygiene' ],
  #        }],
  #    ],
}

test("snappy_unittest") {
  sources = [
    "src/snappy-test.cc",
    "src/snappy-test.h",
    "src/snappy_unittest.cc",
  ]

  configs -= "//build/config/compiler:chromium_code"
  configs += "//build/config/compiler:no_chromium_code"

  deps = [
    ":snappy",
    "//base",
    "//testing:gtest",
    "//third_party/zlib",
  ]
}