OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 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 { | 5 { |
6 'target_defaults': { | 6 'target_defaults': { |
7 'include_dirs': [ | 7 'include_dirs': [ |
8 '../..', # add it first, so src/base headers are used instead of the ones | 8 '../..', # add it first, so src/base headers are used instead of the ones |
9 # brought with the library as cc files would be taken from the | 9 # brought with the library as cc files would be taken from the |
10 # main chrome tree as well. | 10 # main chrome tree as well. |
11 'src', | 11 'cpp/src', |
12 'src/test', | |
13 # The libphonenumber source (and test code) expects the | 12 # The libphonenumber source (and test code) expects the |
14 # generated protocol headers to be available with "phonenumbers" include | 13 # generated protocol headers to be available with no include |
15 # path, e.g. #include "phonenumbers/foo.pb.h". | 14 # path, e.g. #include "foo.pb.h". |
16 '<(SHARED_INTERMEDIATE_DIR)/protoc_out/third_party/libphonenumber', | 15 '<(SHARED_INTERMEDIATE_DIR)/protoc_out/third_party/libphonenumber', |
17 ], | 16 ], |
18 'defines': [ | 17 'defines': [ |
19 'USE_HASH_MAP=1', | 18 'USE_HASH_MAP=1', |
20 'USE_GOOGLE_BASE=1', | 19 'USE_GOOGLE_BASE=1', |
21 'USE_ICU_REGEXP=1', | |
22 ], | 20 ], |
23 }, | 21 }, |
24 'includes': [ | 22 'includes': [ |
25 '../../build/win_precompile.gypi', | 23 '../../build/win_precompile.gypi', |
26 ], | 24 ], |
27 'targets': [{ | 25 'targets': [{ |
28 'target_name': 'libphonenumber', | 26 'target_name': 'libphonenumber', |
29 'type': 'static_library', | 27 'type': 'static_library', |
30 'dependencies': [ | 28 'dependencies': [ |
31 '../icu/icu.gyp:icui18n', | 29 '../icu/icu.gyp:icui18n', |
32 '../icu/icu.gyp:icuuc', | 30 '../icu/icu.gyp:icuuc', |
33 '../../base/base.gyp:base', | 31 '../../base/base.gyp:base', |
34 '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynami
c_annotations', | 32 '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynami
c_annotations', |
35 ], | 33 ], |
36 'sources': [ | 34 'sources': [ |
37 'src/phonenumbers/asyoutypeformatter.cc', | 35 # 'chrome/regexp_adapter_icuregexp.cc', |
38 'src/phonenumbers/default_logger.cc', | 36 'cpp/src/default_logger.cc', |
39 # Comment next line and uncomment the line after, if complete metadata | 37 'cpp/src/lite_metadata.cc', |
40 # (with examples) is needed. | 38 'cpp/src/logger.cc', |
41 'src/phonenumbers/lite_metadata.cc', | 39 'cpp/src/phonenumber.cc', |
42 #'src/phonenumbers/metadata.cc', | 40 'cpp/src/phonenumberutil.cc', |
43 'src/phonenumbers/logger.cc', | 41 'cpp/src/regexp_adapter_icu.cc', |
44 'src/phonenumbers/phonenumber.cc', | 42 'cpp/src/regexp_cache.cc', |
45 # The following two files should be added on 'as needed' basis. | 43 'cpp/src/stringutil.cc', |
46 #'src/phonenumbers/phonenumbermatch.cc', | 44 'cpp/src/utf/rune.c', |
47 #'src/phonenumbers/phonenumbermatcher.cc', | 45 'cpp/src/utf/unicodetext.cc', |
48 'src/phonenumbers/phonenumberutil.cc', | 46 'cpp/src/utf/unilib.cc', |
49 'src/phonenumbers/regexp_adapter_icu.cc', | 47 'resources/phonemetadata.proto', |
50 'src/phonenumbers/regexp_cache.cc', | 48 'resources/phonenumber.proto', |
51 'src/phonenumbers/stringutil.cc', | |
52 'src/phonenumbers/unicodestring.cc', | |
53 'src/phonenumbers/utf/rune.c', | |
54 'src/phonenumbers/utf/unicodetext.cc', | |
55 'src/phonenumbers/utf/unilib.cc', | |
56 'src/resources/phonemetadata.proto', | |
57 'src/resources/phonenumber.proto', | |
58 ], | 49 ], |
59 'direct_dependent_settings': { | 50 'direct_dependent_settings': { |
60 'include_dirs': [ | 51 'include_dirs': [ |
| 52 # The libphonenumber headers expect generated protocol headers |
| 53 # to be available with no include path, e.g. #include |
| 54 # "foo.pb.h". |
61 '<(SHARED_INTERMEDIATE_DIR)/protoc_out/third_party/libphonenumber', | 55 '<(SHARED_INTERMEDIATE_DIR)/protoc_out/third_party/libphonenumber', |
62 ], | 56 ], |
63 }, | 57 }, |
64 'variables': { | 58 'variables': { |
65 'proto_in_dir': 'src/resources', | 59 'proto_in_dir': 'resources', |
66 'proto_out_dir': 'third_party/libphonenumber/phonenumbers', | 60 'proto_out_dir': 'third_party/libphonenumber', |
67 }, | 61 }, |
68 'includes': [ '../../build/protoc.gypi' ], | 62 'includes': [ '../../build/protoc.gypi' ], |
69 'conditions': [ | 63 'conditions': [ |
70 ['OS=="win"', { | 64 ['OS=="win"', { |
71 'action': [ | 65 'action': [ |
72 '/wo4309', | 66 '/wo4309', |
73 ], | 67 ], |
74 }], | 68 }], |
75 ], | 69 ], |
76 }, | 70 }, |
77 { | 71 { |
78 'target_name': 'libphonenumber_unittests', | 72 'target_name': 'libphonenumber_unittests', |
79 'type': 'executable', | 73 'type': 'executable', |
80 'sources': [ | 74 'sources': [ |
81 '../../base/test/run_all_unittests.cc', | 75 '../../base/test/run_all_unittests.cc', |
82 'src/phonenumbers/test_metadata.cc', | 76 'cpp/src/phonenumberutil_test.cc', |
83 'src/test/phonenumbers/asyoutypeformatter_test.cc', | 77 'cpp/src/regexp_adapter_test.cc', |
84 # The following two files should be added on 'as needed' basis. | 78 'cpp/src/stringutil_test.cc', |
85 #'src/test/phonenumbers/phonenumbermatch_test.cc', | 79 'cpp/src/test_metadata.cc', |
86 #'src/test/phonenumbers/phonenumbermatcher_test.cc', | |
87 'src/test/phonenumbers/phonenumberutil_test.cc', | |
88 'src/test/phonenumbers/regexp_adapter_test.cc', | |
89 'src/test/phonenumbers/stringutil_test.cc', | |
90 'src/test/phonenumbers/test_util.cc', | |
91 'src/test/phonenumbers/unicodestring_test.cc', | |
92 ], | 80 ], |
93 'dependencies': [ | 81 'dependencies': [ |
94 '../icu/icu.gyp:icui18n', | 82 '../icu/icu.gyp:icui18n', |
95 '../icu/icu.gyp:icuuc', | 83 '../icu/icu.gyp:icuuc', |
96 '../../base/base.gyp:base', | 84 '../../base/base.gyp:base', |
97 '../../base/base.gyp:test_support_base', | 85 '../../base/base.gyp:test_support_base', |
98 '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynami
c_annotations', | 86 '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynami
c_annotations', |
99 '../../testing/gmock.gyp:gmock', | 87 '../../testing/gmock.gyp:gmock', |
100 '../../testing/gtest.gyp:gtest', | 88 '../../testing/gtest.gyp:gtest', |
101 'libphonenumber', | 89 'libphonenumber', |
102 ], | 90 ], |
103 'conditions': [ | 91 'conditions': [ |
104 ['OS=="win"', { | 92 ['OS=="win"', { |
105 'action': [ | 93 'action': [ |
106 '/wo4309', | 94 '/wo4309', |
107 ], | 95 ], |
108 }], | 96 }], |
109 ], | 97 ], |
110 }] | 98 }] |
111 } | 99 } |
OLD | NEW |