OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 { |
| 6 'variables': { |
| 7 'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out', |
| 8 }, |
| 9 'target_defaults': { |
| 10 'include_dirs': [ |
| 11 '../..', # add it first, so src/base headers are used instead of the ones |
| 12 # brought with the library as cc files would be taken from the |
| 13 # main chrome tree as well. |
| 14 'cpp/src', |
| 15 '<(protoc_out_dir)', |
| 16 '../protobuf/src', |
| 17 '../icu/public/common', |
| 18 '../icu/public/i18n', |
| 19 ], |
| 20 'defines': [ |
| 21 'U_USING_ICU_NAMESPACE=0', |
| 22 ], |
| 23 'conditions': [ |
| 24 ['OS!="win" or component=="static_library"', { |
| 25 'defines': [ |
| 26 'U_STATIC_IMPLEMENTATION', |
| 27 ], |
| 28 }], |
| 29 ], |
| 30 }, |
| 31 'targets': [{ |
| 32 'target_name': 'libphonenumber', |
| 33 'type': '<(library)', |
| 34 'dependencies': [ |
| 35 'phonenumber_proto', |
| 36 ], |
| 37 'sources': [ |
| 38 'chrome/regexp_adapter_icuregexp.cc', |
| 39 'cpp/src/default_logger.cc', |
| 40 'cpp/src/logger_adapter.cc', |
| 41 'cpp/src/metadata.cc', |
| 42 'cpp/src/phonenumber.cc', |
| 43 'cpp/src/phonenumberutil.cc', |
| 44 'cpp/src/stringutil.cc', |
| 45 'cpp/src/utf/rune.c', |
| 46 'cpp/src/utf/unicodetext.cc', |
| 47 'cpp/src/utf/unilib.cc', |
| 48 # Generated by phonenumber_proto. |
| 49 '<(protoc_out_dir)/phonemetadata.pb.cc', |
| 50 '<(protoc_out_dir)/phonenumber.pb.cc', |
| 51 ], |
| 52 'conditions': [ |
| 53 ['OS=="win"', { |
| 54 'action': [ |
| 55 '/wo4309', |
| 56 ], |
| 57 }], |
| 58 ], |
| 59 }, |
| 60 { |
| 61 # Protobuf compiler / generate rule for the phones |
| 62 'target_name': 'phonenumber_proto', |
| 63 'type': 'none', |
| 64 'sources': [ |
| 65 'resources/phonemetadata.proto', |
| 66 'resources/phonenumber.proto', |
| 67 ], |
| 68 'rules': [{ |
| 69 'rule_name': 'genproto', |
| 70 'extension': 'proto', |
| 71 'inputs': [ |
| 72 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 73 ], |
| 74 'variables': { |
| 75 # The protoc compiler requires a proto_path argument with the |
| 76 # directory containing the .proto file. |
| 77 # There's no generator variable that corresponds to this, so fake it. |
| 78 'rule_input_relpath': 'resources', |
| 79 }, |
| 80 'outputs': [ |
| 81 '<(protoc_out_dir)/<(RULE_INPUT_ROOT).pb.h', |
| 82 '<(protoc_out_dir)/<(RULE_INPUT_ROOT).pb.cc', |
| 83 ], |
| 84 'action': [ |
| 85 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 86 '--proto_path=<(rule_input_relpath)', |
| 87 '<(rule_input_relpath)/<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)', |
| 88 '--cpp_out=<(protoc_out_dir)', |
| 89 ], |
| 90 'message': 'Generating C++ code from <(RULE_INPUT_PATH)', |
| 91 }], |
| 92 'dependencies': [ |
| 93 '../protobuf/protobuf.gyp:protobuf_lite', |
| 94 '../protobuf/protobuf.gyp:protoc#host', |
| 95 ], |
| 96 'direct_dependent_settings': { |
| 97 'include_dirs': [ |
| 98 '<(protoc_out_dir)', |
| 99 ] |
| 100 }, |
| 101 'export_dependent_settings': [ |
| 102 '../../third_party/protobuf/protobuf.gyp:protobuf_lite', |
| 103 ], |
| 104 }, |
| 105 { |
| 106 'target_name': 'libphonenumber_unittests', |
| 107 'type': 'executable', |
| 108 'sources': [ |
| 109 '../../base/test/run_all_unittests.cc', |
| 110 'cpp/src/phonenumberutil_test.cc', |
| 111 'cpp/src/regexp_adapter_unittest.cc', |
| 112 'cpp/src/stringutil_test.cc', |
| 113 'cpp/src/test_metadata.cc', |
| 114 ], |
| 115 'dependencies': [ |
| 116 '../icu/icu.gyp:icui18n', |
| 117 '../icu/icu.gyp:icuuc', |
| 118 '../protobuf/protobuf.gyp:protobuf_lite', |
| 119 '../../base/base.gyp:base', |
| 120 '../../base/base.gyp:test_support_base', |
| 121 '../../testing/gmock.gyp:gmock', |
| 122 '../../testing/gtest.gyp:gtest', |
| 123 'libphonenumber', |
| 124 ], |
| 125 'conditions': [ |
| 126 ['OS=="win"', { |
| 127 'action': [ |
| 128 '/wo4309', |
| 129 ], |
| 130 }], |
| 131 ], |
| 132 }] |
| 133 } |
OLD | NEW |