| 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 import("//testing/test.gni") |
| 6 |
| 5 config("snappy_config") { | 7 config("snappy_config") { |
| 6 include_dirs = [ "src" ] | 8 include_dirs = [ "src" ] |
| 7 | 9 |
| 8 # These OS-specific generated headers were made by running the configure | 10 # These OS-specific generated headers were made by running the configure |
| 9 # script offline. | 11 # script offline. |
| 10 if (is_win) { | 12 if (is_win) { |
| 11 include_dirs += [ "win32" ] | 13 include_dirs += [ "win32" ] |
| 12 } else if (is_mac) { | 14 } else if (is_mac) { |
| 13 include_dirs += [ "mac" ] | 15 include_dirs += [ "mac" ] |
| 14 } else { | 16 } else { |
| 15 include_dirs += [ "linux" ] | 17 include_dirs += [ "linux" ] |
| 16 } | 18 } |
| 17 } | 19 } |
| 18 | 20 |
| 19 config("snappy_warnings") { | 21 config("snappy_warnings") { |
| 22 cflags = [] |
| 23 |
| 20 if (is_clang) { | 24 if (is_clang) { |
| 21 # ComputeTable is unused, | 25 # ComputeTable is unused, |
| 22 # https://code.google.com/p/snappy/issues/detail?id=96 | 26 # https://code.google.com/p/snappy/issues/detail?id=96 |
| 23 cflags = [ "-Wno-unused-function" ] | 27 cflags += [ "-Wno-unused-function" ] |
| 28 } |
| 29 |
| 30 if (is_win) { |
| 31 cflags += [ "/wd4018" ] # Signed/unsigned mismatch in comparison. |
| 24 } | 32 } |
| 25 } | 33 } |
| 26 | 34 |
| 27 static_library("snappy") { | 35 static_library("snappy") { |
| 28 sources = [ | 36 sources = [ |
| 29 "src/snappy-internal.h", | 37 "src/snappy-internal.h", |
| 30 "src/snappy-sinksource.cc", | 38 "src/snappy-sinksource.cc", |
| 31 "src/snappy-sinksource.h", | 39 "src/snappy-sinksource.h", |
| 32 "src/snappy-stubs-internal.cc", | 40 "src/snappy-stubs-internal.cc", |
| 33 "src/snappy-stubs-internal.h", | 41 "src/snappy-stubs-internal.h", |
| 34 "src/snappy.cc", | 42 "src/snappy.cc", |
| 35 "src/snappy.h", | 43 "src/snappy.h", |
| 36 ] | 44 ] |
| 37 | 45 |
| 38 configs -= [ "//build/config/compiler:chromium_code" ] | 46 configs -= [ "//build/config/compiler:chromium_code" ] |
| 39 configs += [ | 47 configs += [ |
| 40 "//build/config/compiler:no_chromium_code", | 48 "//build/config/compiler:no_chromium_code", |
| 41 | 49 |
| 42 # Must be after no_chromium_code for warning flags to be ordered correctly. | 50 # Must be after no_chromium_code for warning flags to be ordered correctly. |
| 43 ":snappy_warnings", | 51 ":snappy_warnings", |
| 44 ] | 52 ] |
| 45 public_configs = [ ":snappy_config" ] | 53 public_configs = [ ":snappy_config" ] |
| 46 | 54 |
| 47 if (is_win) { | 55 # Chromium doesn't use automake, but we generated config.h offline for all the |
| 48 cflags = [ "/wd4018" ] # Signed/unsigned mismatch in comparison. | 56 # platforms that we build for. |
| 49 } | 57 defines = [ "HAVE_CONFIG_H" ] |
| 50 | 58 |
| 51 if (is_clang) { | 59 if (is_clang) { |
| 52 # snappy-stubs-internal.h unapologetically has: using namespace std | 60 # snappy-stubs-internal.h unapologetically has: using namespace std |
| 53 # https://code.google.com/p/snappy/issues/detail?id=70 | 61 # https://code.google.com/p/snappy/issues/detail?id=70 |
| 54 configs -= [ "//build/config/clang:extra_warnings" ] | 62 configs -= [ "//build/config/clang:extra_warnings" ] |
| 55 } | 63 } |
| 56 } | 64 } |
| OLD | NEW |