1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//testing/test.gni")
6 import("//third_party/protobuf/proto_library.gni")
8 proto_library("proto") {
10 "src/resources/phonemetadata.proto",
11 "src/resources/phonenumber.proto",
13 proto_out_dir = "third_party/libphonenumber/phonenumbers"
16 config("libphonenumber_config") {
19 "$root_gen_dir/third_party/libphonenumber",
21 defines = [ "I18N_PHONENUMBERS_USE_ICU_REGEXP=1" ]
23 defines += [ "I18N_PHONENUMBERS_NO_THREAD_SAFETY=1" ]
27 # GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_without_metadata
28 static_library("libphonenumber_without_metadata") {
30 "src/phonenumbers/asyoutypeformatter.cc",
31 "src/phonenumbers/base/strings/string_piece.cc",
32 "src/phonenumbers/default_logger.cc",
33 "src/phonenumbers/logger.cc",
34 "src/phonenumbers/phonenumber.cc",
35 "src/phonenumbers/phonenumbermatch.cc",
36 "src/phonenumbers/phonenumbermatcher.cc",
37 "src/phonenumbers/phonenumberutil.cc",
38 "src/phonenumbers/regexp_adapter_icu.cc",
39 "src/phonenumbers/regexp_cache.cc",
40 "src/phonenumbers/string_byte_sink.cc",
41 "src/phonenumbers/stringutil.cc",
42 "src/phonenumbers/unicodestring.cc",
43 "src/phonenumbers/utf/rune.c",
44 "src/phonenumbers/utf/unicodetext.cc",
45 "src/phonenumbers/utf/unilib.cc",
48 # libphonenumber's base/logging.h is a minimal implementation where DCHECKs
49 # do not consume their arguments. This leads to unused variable warnings in
51 configs -= [ "//build/config/compiler:chromium_code" ]
52 configs += [ "//build/config/compiler:no_chromium_code" ]
54 public_configs = [ ":libphonenumber_config" ]
62 "//third_party/protobuf:protobuf_lite",
66 # Library used by clients that includes production metadata.
67 # GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber
68 static_library("libphonenumber") {
70 # Comment next line and uncomment the line after, if complete metadata
71 # (with examples) is needed.
72 "src/phonenumbers/lite_metadata.cc",
73 #"src/phonenumbers/metadata.cc",
77 ":libphonenumber_without_metadata",
81 # GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests
82 test("libphonenumber_unittests") {
84 "src/phonenumbers/test_metadata.cc",
85 "src/test/phonenumbers/asyoutypeformatter_test.cc",
86 "src/test/phonenumbers/phonenumbermatch_test.cc",
87 "src/test/phonenumbers/phonenumbermatcher_test.cc",
88 "src/test/phonenumbers/phonenumberutil_test.cc",
89 "src/test/phonenumbers/regexp_adapter_test.cc",
90 "src/test/phonenumbers/stringutil_test.cc",
91 "src/test/phonenumbers/test_util.cc",
92 "src/test/phonenumbers/unicodestring_test.cc",
95 include_dirs = [ "src/test" ]
98 ":libphonenumber_without_metadata",
100 "//base/test:run_all_unittests",
101 "//base/third_party/dynamic_annotations",