naiveproxy/third_party/snappy/BUILD.gn
2018-12-09 21:59:24 -05:00

67 lines
1.6 KiB
Plaintext

# 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.
import("//testing/test.gni")
config("snappy_config") {
include_dirs = [ "src" ]
# These OS-specific generated headers were made by running the configure
# script offline.
if (is_win) {
include_dirs += [ "win32" ]
} else if (is_mac) {
include_dirs += [ "mac" ]
} else {
include_dirs += [ "linux" ]
}
}
config("snappy_warnings") {
cflags = []
if (is_clang) {
# ComputeTable is unused,
# https://code.google.com/p/snappy/issues/detail?id=96
cflags += [ "-Wno-unused-function" ]
}
if (is_win) {
cflags += [ "/wd4018" ] # Signed/unsigned mismatch in comparison.
}
}
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",
]
if (is_win) {
sources += [ "win32/snappy-stubs-public.h" ]
} else if (is_mac) {
sources += [ "mac/snappy-stubs-public.h" ]
} else {
sources += [ "linux/snappy-stubs-public.h" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
# Must be after no_chromium_code for warning flags to be ordered correctly.
":snappy_warnings",
]
public_configs = [ ":snappy_config" ]
# Chromium doesn't use automake, but we generated config.h offline for all the
# platforms that we build for.
defines = [ "HAVE_CONFIG_H" ]
}