OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 config("snappy_config") { | 5 config("snappy_config") { |
6 include_dirs = [ "src" ] | 6 include_dirs = [ "src" ] |
7 | 7 |
8 # These OS-specific generated headers were made by running the configure | 8 # These OS-specific generated headers were made by running the configure |
9 # script offline. | 9 # script offline. |
10 if (is_win) { | 10 if (is_win) { |
11 include_dirs += [ "win32" ] | 11 include_dirs += [ "win32" ] |
12 } else if (is_mac) { | 12 } else if (is_mac) { |
13 include_dirs += [ "mac" ] | 13 include_dirs += [ "mac" ] |
14 } else { | 14 } else { |
15 include_dirs += [ "linux" ] | 15 include_dirs += [ "linux" ] |
16 } | 16 } |
17 } | 17 } |
18 | 18 |
19 config("snappy_warnings") { | |
20 if (is_clang) { | |
21 # ComputeTable is unused, | |
22 # https://code.google.com/p/snappy/issues/detail?id=96 | |
23 cflags = [ "-Wno-unused-function" ] | |
24 } | |
25 } | |
26 | |
27 static_library("snappy") { | 19 static_library("snappy") { |
28 sources = [ | 20 sources = [ |
29 "src/snappy-internal.h", | 21 "src/snappy-internal.h", |
30 "src/snappy-sinksource.cc", | 22 "src/snappy-sinksource.cc", |
31 "src/snappy-sinksource.h", | 23 "src/snappy-sinksource.h", |
32 "src/snappy-stubs-internal.cc", | 24 "src/snappy-stubs-internal.cc", |
33 "src/snappy-stubs-internal.h", | 25 "src/snappy-stubs-internal.h", |
34 "src/snappy.cc", | 26 "src/snappy.cc", |
35 "src/snappy.h", | 27 "src/snappy.h", |
36 ] | 28 ] |
37 | 29 |
| 30 config("snappy_warnings") { |
| 31 if (is_clang) { |
| 32 # ComputeTable is unused, |
| 33 # https://code.google.com/p/snappy/issues/detail?id=96 |
| 34 cflags = [ "-Wno-unused-function" ] |
| 35 } |
| 36 } |
38 configs -= [ "//build/config/compiler:chromium_code" ] | 37 configs -= [ "//build/config/compiler:chromium_code" ] |
39 configs += [ | 38 configs += [ "//build/config/compiler:no_chromium_code" ] |
40 ":snappy_warnings", | 39 configs += [ ":snappy_warnings" ] |
41 "//build/config/compiler:no_chromium_code", | |
42 ] | |
43 public_configs = [ ":snappy_config" ] | 40 public_configs = [ ":snappy_config" ] |
44 | 41 |
45 if (is_win) { | 42 if (is_win) { |
46 cflags = [ "/wd4018" ] # Signed/unsigned mismatch in comparison. | 43 cflags = [ "/wd4018" ] # Signed/unsigned mismatch in comparison. |
47 } | 44 } |
48 | 45 |
49 if (is_clang) { | 46 if (is_clang) { |
50 # snappy-stubs-internal.h unapologetically has: using namespace std | 47 # snappy-stubs-internal.h unapologetically has: using namespace std |
51 # https://code.google.com/p/snappy/issues/detail?id=70 | 48 # https://code.google.com/p/snappy/issues/detail?id=70 |
52 configs -= [ "//build/config/clang:extra_warnings" ] | 49 configs -= [ "//build/config/clang:extra_warnings" ] |
53 } | 50 } |
54 } | 51 } |
OLD | NEW |