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 'defines': [ |
| 55 'COMPILER_MSVC=1', |
| 56 'OS_WIN=1', |
| 57 'ARCH_CPU_X86_FAMILY=1', |
| 58 ], |
| 59 'action': [ |
| 60 '/wo4309', |
| 61 ], |
| 62 }], |
| 63 ['OS=="linux"', { |
| 64 'defines': [ |
| 65 'COMPILER_GCC=1', |
| 66 'OS_POSIX=1', |
| 67 'OS_LINUX=1', |
| 68 ], |
| 69 }], |
| 70 ['OS=="mac"', { |
| 71 'defines': [ |
| 72 'OS_MACOSX=1', |
| 73 ], |
| 74 }], # OS=="mac" |
| 75 ], |
| 76 }, |
| 77 { |
| 78 # Protobuf compiler / generate rule for the phones |
| 79 'target_name': 'phonenumber_proto', |
| 80 'type': 'none', |
| 81 'sources': [ |
| 82 'resources/phonemetadata.proto', |
| 83 'resources/phonenumber.proto', |
| 84 ], |
| 85 'rules': [{ |
| 86 'rule_name': 'genproto', |
| 87 'extension': 'proto', |
| 88 'inputs': [ |
| 89 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 90 ], |
| 91 'variables': { |
| 92 # The protoc compiler requires a proto_path argument with the |
| 93 # directory containing the .proto file. |
| 94 # There's no generator variable that corresponds to this, so fake it. |
| 95 'rule_input_relpath': 'resources', |
| 96 }, |
| 97 'outputs': [ |
| 98 '<(protoc_out_dir)/<(RULE_INPUT_ROOT).pb.h', |
| 99 '<(protoc_out_dir)/<(RULE_INPUT_ROOT).pb.cc', |
| 100 ], |
| 101 'action': [ |
| 102 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 103 '--proto_path=<(rule_input_relpath)', |
| 104 '<(rule_input_relpath)/<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)', |
| 105 '--cpp_out=<(protoc_out_dir)', |
| 106 ], |
| 107 'message': 'Generating C++ code from <(RULE_INPUT_PATH)', |
| 108 }], |
| 109 'dependencies': [ |
| 110 '../protobuf/protobuf.gyp:protobuf_lite', |
| 111 '../protobuf/protobuf.gyp:protoc#host', |
| 112 ], |
| 113 'direct_dependent_settings': { |
| 114 'include_dirs': [ |
| 115 '<(protoc_out_dir)', |
| 116 ] |
| 117 }, |
| 118 'export_dependent_settings': [ |
| 119 '../../third_party/protobuf/protobuf.gyp:protobuf_lite', |
| 120 ], |
| 121 }, |
| 122 { |
| 123 'target_name': 'libphonenumber_unittests', |
| 124 'type': 'executable', |
| 125 'sources': [ |
| 126 '../../base/test/run_all_unittests.cc', |
| 127 'cpp/src/phonenumberutil_test.cc', |
| 128 'cpp/src/regexp_adapter_unittest.cc', |
| 129 'cpp/src/stringutil_test.cc', |
| 130 'cpp/src/test_metadata.cc', |
| 131 ], |
| 132 'dependencies': [ |
| 133 '../icu/icu.gyp:icui18n', |
| 134 '../icu/icu.gyp:icuuc', |
| 135 '../protobuf/protobuf.gyp:protobuf_lite', |
| 136 '../../base/base.gyp:base', |
| 137 '../../base/base.gyp:test_support_base', |
| 138 '../../testing/gmock.gyp:gmock', |
| 139 '../../testing/gtest.gyp:gtest', |
| 140 'libphonenumber', |
| 141 ], |
| 142 'conditions': [ |
| 143 ['OS=="win"', { |
| 144 'defines': [ |
| 145 'COMPILER_MSVC=1', |
| 146 'OS_WIN=1', |
| 147 'ARCH_CPU_X86_FAMILY=1', |
| 148 ], |
| 149 'action': [ |
| 150 '/wo4309', |
| 151 ], |
| 152 },], |
| 153 ['OS=="linux"', { |
| 154 'defines': [ |
| 155 'COMPILER_GCC=1', |
| 156 'OS_POSIX=1', |
| 157 'OS_LINUX=1', |
| 158 ], |
| 159 },], |
| 160 ['OS=="mac"', { |
| 161 'defines': [ |
| 162 'OS_MAC=1', |
| 163 ], |
| 164 }], # OS=="mac" |
| 165 ], |
| 166 }] |
| 167 } |
OLD | NEW |