blob: a428292e196cdb08403245d14ccf94be4b63bc6e [file] [log] [blame]
# Copyright 2014 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")
import("//third_party/protobuf/proto_library.gni")
proto_library("proto") {
sources = [
"src/resources/phonemetadata.proto",
"src/resources/phonenumber.proto",
]
proto_out_dir = "third_party/libphonenumber/phonenumbers"
}
config("libphonenumber_config") {
include_dirs = [
"src",
"$root_gen_dir/third_party/libphonenumber",
]
defines = [ "I18N_PHONENUMBERS_USE_ICU_REGEXP=1" ]
if (!is_android) {
defines += [ "I18N_PHONENUMBERS_NO_THREAD_SAFETY=1" ]
}
}
# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_without_metadata
static_library("libphonenumber_without_metadata") {
sources = [
"src/phonenumbers/asyoutypeformatter.cc",
"src/phonenumbers/base/strings/string_piece.cc",
"src/phonenumbers/default_logger.cc",
"src/phonenumbers/logger.cc",
"src/phonenumbers/phonenumber.cc",
"src/phonenumbers/phonenumbermatch.cc",
"src/phonenumbers/phonenumbermatcher.cc",
"src/phonenumbers/phonenumberutil.cc",
"src/phonenumbers/regexp_adapter_icu.cc",
"src/phonenumbers/regexp_cache.cc",
"src/phonenumbers/string_byte_sink.cc",
"src/phonenumbers/stringutil.cc",
"src/phonenumbers/unicodestring.cc",
"src/phonenumbers/utf/rune.c",
"src/phonenumbers/utf/unicodetext.cc",
"src/phonenumbers/utf/unilib.cc",
]
# libphonenumber's base/logging.h is a minimal implementation where DCHECKs
# do not consume their arguments. This leads to unused variable warnings in
# release builds.
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":libphonenumber_config" ]
public_deps = [
":proto",
]
deps = [
":proto",
"//third_party/icu",
"//third_party/protobuf:protobuf_lite",
]
}
# Library used by clients that includes production metadata.
# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber
static_library("libphonenumber") {
sources = [
# Comment next line and uncomment the line after, if complete metadata
# (with examples) is needed.
"src/phonenumbers/lite_metadata.cc",
#"src/phonenumbers/metadata.cc",
]
public_deps = [
":libphonenumber_without_metadata",
]
}
# GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests
test("libphonenumber_unittests") {
sources = [
"src/phonenumbers/test_metadata.cc",
"src/test/phonenumbers/asyoutypeformatter_test.cc",
"src/test/phonenumbers/phonenumbermatch_test.cc",
"src/test/phonenumbers/phonenumbermatcher_test.cc",
"src/test/phonenumbers/phonenumberutil_test.cc",
"src/test/phonenumbers/regexp_adapter_test.cc",
"src/test/phonenumbers/stringutil_test.cc",
"src/test/phonenumbers/test_util.cc",
"src/test/phonenumbers/unicodestring_test.cc",
]
include_dirs = [ "src/test" ]
deps = [
":libphonenumber_without_metadata",
"//base",
"//base/test:run_all_unittests",
"//base/third_party/dynamic_annotations",
"//third_party/icu",
"//testing/gmock",
"//testing/gtest",
]
}