OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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") | 5 import("//testing/test.gni") |
6 import("//third_party/protobuf/proto_library.gni") | 6 import("//third_party/protobuf/proto_library.gni") |
7 | 7 |
8 proto_library("proto") { | 8 proto_library("proto") { |
9 sources = [ | 9 sources = [ |
10 "src/resources/phonemetadata.proto", | 10 "src/resources/phonemetadata.proto", |
11 "src/resources/phonenumber.proto", | 11 "src/resources/phonenumber.proto", |
12 ] | 12 ] |
13 proto_out_dir = "third_party/libphonenumber/phonenumbers" | 13 proto_out_dir = "third_party/libphonenumber/phonenumbers" |
14 } | 14 } |
15 | 15 |
16 config("libphonenumber_config") { | 16 config("libphonenumber_config") { |
17 include_dirs = [ | 17 include_dirs = [ |
18 "src", | 18 "src", |
19 "$root_gen_dir/third_party/libphonenumber", | 19 "$root_gen_dir/third_party/libphonenumber", |
20 ] | 20 ] |
21 defines = [ "I18N_PHONENUMBERS_USE_ICU_REGEXP=1" ] | 21 defines = [ "I18N_PHONENUMBERS_USE_ICU_REGEXP=1" ] |
22 if (!is_android) { | 22 if (!is_android) { |
23 defines += [ "I18N_PHONENUMBERS_NO_THREAD_SAFETY=1" ] | 23 defines += [ "I18N_PHONENUMBERS_NO_THREAD_SAFETY=1" ] |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
| 27 config("libphonenumber_config_internal") { |
| 28 if (is_clang) { |
| 29 cflags = [ |
| 30 # https://github.com/googlei18n/libphonenumber/pull/741 |
| 31 "-Wno-unused-private-field", |
| 32 ] |
| 33 } |
| 34 } |
| 35 |
27 # GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_with
out_metadata | 36 # GYP version: third_party/libphonenumber/libphonenumber.gyp:libphonenumber_with
out_metadata |
28 static_library("libphonenumber_without_metadata") { | 37 static_library("libphonenumber_without_metadata") { |
29 sources = [ | 38 sources = [ |
30 "src/phonenumbers/asyoutypeformatter.cc", | 39 "src/phonenumbers/asyoutypeformatter.cc", |
31 "src/phonenumbers/base/strings/string_piece.cc", | 40 "src/phonenumbers/base/strings/string_piece.cc", |
32 "src/phonenumbers/default_logger.cc", | 41 "src/phonenumbers/default_logger.cc", |
33 "src/phonenumbers/logger.cc", | 42 "src/phonenumbers/logger.cc", |
34 "src/phonenumbers/phonenumber.cc", | 43 "src/phonenumbers/phonenumber.cc", |
35 "src/phonenumbers/phonenumbermatch.cc", | 44 "src/phonenumbers/phonenumbermatch.cc", |
36 "src/phonenumbers/phonenumbermatcher.cc", | 45 "src/phonenumbers/phonenumbermatcher.cc", |
37 "src/phonenumbers/phonenumberutil.cc", | 46 "src/phonenumbers/phonenumberutil.cc", |
38 "src/phonenumbers/regexp_adapter_icu.cc", | 47 "src/phonenumbers/regexp_adapter_icu.cc", |
39 "src/phonenumbers/regexp_cache.cc", | 48 "src/phonenumbers/regexp_cache.cc", |
40 "src/phonenumbers/string_byte_sink.cc", | 49 "src/phonenumbers/string_byte_sink.cc", |
41 "src/phonenumbers/stringutil.cc", | 50 "src/phonenumbers/stringutil.cc", |
42 "src/phonenumbers/unicodestring.cc", | 51 "src/phonenumbers/unicodestring.cc", |
43 "src/phonenumbers/utf/rune.c", | 52 "src/phonenumbers/utf/rune.c", |
44 "src/phonenumbers/utf/unicodetext.cc", | 53 "src/phonenumbers/utf/unicodetext.cc", |
45 "src/phonenumbers/utf/unilib.cc", | 54 "src/phonenumbers/utf/unilib.cc", |
46 ] | 55 ] |
47 | 56 |
48 # libphonenumber's base/logging.h is a minimal implementation where DCHECKs | 57 # libphonenumber's base/logging.h is a minimal implementation where DCHECKs |
49 # do not consume their arguments. This leads to unused variable warnings in | 58 # do not consume their arguments. This leads to unused variable warnings in |
50 # release builds. | 59 # release builds. |
51 configs -= [ "//build/config/compiler:chromium_code" ] | 60 configs -= [ "//build/config/compiler:chromium_code" ] |
52 configs += [ "//build/config/compiler:no_chromium_code" ] | 61 configs += [ |
53 | 62 "//build/config/compiler:no_chromium_code", |
54 config("libphonenumber_without_metadata_warnings") { | 63 ":libphonenumber_config_internal", |
55 if (is_clang) { | 64 ] |
56 cflags = [ | |
57 # https://github.com/googlei18n/libphonenumber/pull/741 | |
58 "-Wno-unused-private-field", | |
59 ] | |
60 } | |
61 } | |
62 configs += [ ":libphonenumber_without_metadata_warnings" ] | |
63 | 65 |
64 public_configs = [ ":libphonenumber_config" ] | 66 public_configs = [ ":libphonenumber_config" ] |
65 | 67 |
66 public_deps = [ | 68 public_deps = [ |
67 ":proto", | 69 ":proto", |
68 ] | 70 ] |
69 deps = [ | 71 deps = [ |
70 ":proto", | 72 ":proto", |
71 "//third_party/icu", | 73 "//third_party/icu", |
72 "//third_party/protobuf:protobuf_lite", | 74 "//third_party/protobuf:protobuf_lite", |
(...skipping 22 matching lines...) Expand all Loading... |
95 "src/test/phonenumbers/asyoutypeformatter_test.cc", | 97 "src/test/phonenumbers/asyoutypeformatter_test.cc", |
96 "src/test/phonenumbers/phonenumbermatch_test.cc", | 98 "src/test/phonenumbers/phonenumbermatch_test.cc", |
97 "src/test/phonenumbers/phonenumbermatcher_test.cc", | 99 "src/test/phonenumbers/phonenumbermatcher_test.cc", |
98 "src/test/phonenumbers/phonenumberutil_test.cc", | 100 "src/test/phonenumbers/phonenumberutil_test.cc", |
99 "src/test/phonenumbers/regexp_adapter_test.cc", | 101 "src/test/phonenumbers/regexp_adapter_test.cc", |
100 "src/test/phonenumbers/stringutil_test.cc", | 102 "src/test/phonenumbers/stringutil_test.cc", |
101 "src/test/phonenumbers/test_util.cc", | 103 "src/test/phonenumbers/test_util.cc", |
102 "src/test/phonenumbers/unicodestring_test.cc", | 104 "src/test/phonenumbers/unicodestring_test.cc", |
103 ] | 105 ] |
104 | 106 |
| 107 configs += [ ":libphonenumber_config_internal" ] |
| 108 |
105 include_dirs = [ "src/test" ] | 109 include_dirs = [ "src/test" ] |
106 | 110 |
107 deps = [ | 111 deps = [ |
108 ":libphonenumber_without_metadata", | 112 ":libphonenumber_without_metadata", |
109 "//base", | 113 "//base", |
110 "//base/test:run_all_unittests", | 114 "//base/test:run_all_unittests", |
111 "//base/third_party/dynamic_annotations", | 115 "//base/third_party/dynamic_annotations", |
112 "//third_party/icu", | 116 "//third_party/icu", |
113 "//testing/gmock", | 117 "//testing/gmock", |
114 "//testing/gtest", | 118 "//testing/gtest", |
115 ] | 119 ] |
116 } | 120 } |
OLD | NEW |