OLD | NEW |
(Empty) | |
| 1 # Copyright (C) 2013 Google Inc. |
| 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at |
| 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 # See the License for the specific language governing permissions and |
| 13 # limitations under the License. |
| 14 { |
| 15 'variables': { |
| 16 'component%': 'shared_library', |
| 17 }, |
| 18 'target_defaults': { |
| 19 'conditions': [ |
| 20 ['OS == "linux" and "<(component)" == "shared_library"', { |
| 21 # https://code.google.com/p/gyp/issues/detail?id=374 |
| 22 'cflags': ['-fPIC'], |
| 23 }], |
| 24 ], |
| 25 'include_dirs': [ |
| 26 'include', |
| 27 ], |
| 28 }, |
| 29 'targets': [ |
| 30 { |
| 31 'target_name': 'libaddressinput', |
| 32 'type': '<(component)', |
| 33 'sources': [ |
| 34 'src/address_field.cc', |
| 35 'src/address_field_util.cc', |
| 36 'src/address_ui.cc', |
| 37 'src/localization.cc', |
| 38 'src/lookup_key_util.cc', |
| 39 'src/region_data_constants.cc', |
| 40 'src/retriever.cc', |
| 41 'src/rule.cc', |
| 42 'src/rule_retriever.cc', |
| 43 'src/util/json.cc', |
| 44 'src/util/md5.cc', |
| 45 'src/validating_storage.cc', |
| 46 'src/validating_util.cc', |
| 47 ], |
| 48 'dependencies': [ |
| 49 'grit.gyp:generated_messages', |
| 50 'rapidjson.gyp:rapidjson', |
| 51 ], |
| 52 }, |
| 53 { |
| 54 'target_name': 'unit_tests', |
| 55 'type': 'executable', |
| 56 'sources': [ |
| 57 'test/address_field_util_test.cc', |
| 58 'test/address_ui_test.cc', |
| 59 'test/fake_downloader.cc', |
| 60 'test/fake_downloader_test.cc', |
| 61 'test/fake_storage.cc', |
| 62 'test/fake_storage_test.cc', |
| 63 'test/localization_test.cc', |
| 64 'test/lookup_key_util_test.cc', |
| 65 'test/region_data_constants_test.cc', |
| 66 'test/retriever_test.cc', |
| 67 'test/rule_retriever_test.cc', |
| 68 'test/rule_test.cc', |
| 69 'test/util/json_test.cc', |
| 70 'test/util/md5_unittest.cc', |
| 71 'test/util/scoped_ptr_unittest.cc', |
| 72 'test/validating_storage_test.cc', |
| 73 'test/validating_util_test.cc', |
| 74 ], |
| 75 'defines': [ |
| 76 'TEST_DATA_DIR="../testdata"', |
| 77 ], |
| 78 'include_dirs': [ |
| 79 'src', |
| 80 ], |
| 81 'dependencies': [ |
| 82 'libaddressinput', |
| 83 'gtest.gyp:main', |
| 84 ], |
| 85 'conditions': [ |
| 86 [ 'OS == "mac"', { |
| 87 'postbuilds': [ |
| 88 { |
| 89 # To make it possible to execute the unit tests directly from the |
| 90 # build directory, without first installing the library, the path |
| 91 # to the library is set to be relative to the unit test executable |
| 92 # (so that also the library will be loaded directly from the build |
| 93 # directory). |
| 94 'postbuild_name': 'Make dylib path relative to executable', |
| 95 'action': [ |
| 96 'install_name_tool', |
| 97 '-change', |
| 98 '/usr/local/lib/libaddressinput.dylib', |
| 99 '@executable_path/libaddressinput.dylib', |
| 100 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}' |
| 101 ], |
| 102 }, |
| 103 ], |
| 104 }], |
| 105 ], |
| 106 }, |
| 107 ], |
| 108 } |
OLD | NEW |