[email protected] | 2d6893a | 2014-06-02 19:16:36 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | # Note that this build file assumes rlz_use_chrome_net which is a condition in |
| 6 | # the GYP file, but is always true for Chrome builds. |
| 7 | |
qsr | fb5251d1 | 2015-01-21 15:57:22 | [diff] [blame] | 8 | import("//testing/test.gni") |
| 9 | |
[email protected] | 2d6893a | 2014-06-02 19:16:36 | [diff] [blame] | 10 | config("rlz_config") { |
| 11 | defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ] |
| 12 | } |
| 13 | |
yusufo | 935ffc1 | 2017-05-05 21:25:15 | [diff] [blame] | 14 | source_set("rlz_utils") { |
| 15 | sources = [ |
| 16 | "lib/assert.cc", |
| 17 | "lib/assert.h", |
| 18 | "lib/crc32.h", |
| 19 | "lib/crc32_wrapper.cc", |
| 20 | "lib/lib_values.cc", |
| 21 | "lib/lib_values.h", |
| 22 | "lib/net_response_check.cc", |
| 23 | "lib/net_response_check.h", |
| 24 | "lib/rlz_api.h", |
| 25 | "lib/rlz_enums.h", |
| 26 | "lib/string_utils.cc", |
| 27 | "lib/string_utils.h", |
| 28 | ] |
| 29 | |
| 30 | public_configs = [ ":rlz_config" ] |
| 31 | |
| 32 | deps = [ |
| 33 | "//base", |
| 34 | "//net", |
| 35 | "//third_party/zlib", |
| 36 | "//url", |
| 37 | ] |
| 38 | } |
| 39 | |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 40 | if (!is_android) { |
| 41 | source_set("rlz_lib") { |
| 42 | sources = [ |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 43 | "chromeos/lib/rlz_value_store_chromeos.cc", |
| 44 | "chromeos/lib/rlz_value_store_chromeos.h", |
| 45 | "ios/lib/machine_id_ios.cc", |
| 46 | "lib/crc8.cc", |
| 47 | "lib/crc8.h", |
| 48 | "lib/financial_ping.cc", |
| 49 | "lib/financial_ping.h", |
| 50 | "lib/machine_id.cc", |
| 51 | "lib/machine_id.h", |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 52 | "lib/rlz_lib.cc", |
| 53 | "lib/rlz_lib.h", |
| 54 | "lib/rlz_lib_clear.cc", |
| 55 | "lib/rlz_value_store.h", |
| 56 | "mac/lib/machine_id_mac.cc", |
| 57 | "mac/lib/rlz_value_store_mac.h", |
| 58 | "mac/lib/rlz_value_store_mac.mm", |
| 59 | "win/lib/lib_mutex.cc", |
| 60 | "win/lib/lib_mutex.h", |
| 61 | "win/lib/machine_deal.cc", |
| 62 | "win/lib/machine_deal.h", |
| 63 | "win/lib/machine_id_win.cc", |
| 64 | "win/lib/process_info.cc", |
| 65 | "win/lib/process_info.h", |
| 66 | "win/lib/registry_util.cc", |
| 67 | "win/lib/registry_util.h", |
| 68 | "win/lib/rlz_lib_win.cc", |
| 69 | "win/lib/rlz_value_store_registry.cc", |
| 70 | "win/lib/rlz_value_store_registry.h", |
| 71 | ] |
| 72 | |
| 73 | # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 74 | configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 75 | |
| 76 | public_configs = [ ":rlz_config" ] |
| 77 | |
| 78 | deps = [ |
| 79 | ":rlz_utils", |
| 80 | "//base", |
| 81 | "//base/third_party/dynamic_annotations", |
| 82 | "//net", |
Antonio Gomes | a739bf46 | 2018-08-13 20:50:30 | [diff] [blame] | 83 | "//services/network/public/cpp:cpp", |
| 84 | "//services/network/public/mojom", |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 85 | "//url", |
| 86 | ] |
| 87 | |
Fabrice de Gans-Riberi | c15a51a | 2018-04-20 21:19:00 | [diff] [blame] | 88 | if (is_posix) { |
| 89 | sources += [ |
| 90 | "lib/recursive_cross_process_lock_posix.cc", |
| 91 | "lib/recursive_cross_process_lock_posix.h", |
| 92 | ] |
| 93 | } |
Wenzhao Zang | 8242fb6 | 2018-03-24 01:40:51 | [diff] [blame] | 94 | if (is_chromeos) { |
| 95 | deps += [ "//chromeos" ] |
| 96 | } |
| 97 | |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 98 | if (is_mac) { |
| 99 | libs = [ |
| 100 | "Foundation.framework", |
| 101 | "IOKit.framework", |
| 102 | ] |
| 103 | } |
| 104 | |
| 105 | if (is_ios) { |
| 106 | # These _mac files are also used on iOS. |
| 107 | set_sources_assignment_filter([]) |
| 108 | sources += [ |
| 109 | "mac/lib/rlz_value_store_mac.h", |
| 110 | "mac/lib/rlz_value_store_mac.mm", |
| 111 | ] |
| 112 | set_sources_assignment_filter(sources_assignment_filter) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | source_set("test_support") { |
| 117 | testonly = true |
| 118 | sources = [ |
| 119 | "test/rlz_test_helpers.cc", |
| 120 | "test/rlz_test_helpers.h", |
| 121 | ] |
| 122 | deps = [ |
| 123 | ":rlz_lib", |
| 124 | "//base", |
| 125 | "//base/test:test_support", |
Antonio Gomes | a739bf46 | 2018-08-13 20:50:30 | [diff] [blame] | 126 | "//services/network/public/cpp:cpp", |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 127 | "//testing/gtest", |
| 128 | ] |
Wenzhao Zang | 8242fb6 | 2018-03-24 01:40:51 | [diff] [blame] | 129 | if (is_chromeos) { |
| 130 | deps += [ "//chromeos" ] |
| 131 | } |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | test("rlz_unittests") { |
| 135 | sources = [ |
| 136 | "lib/crc32_unittest.cc", |
| 137 | "lib/crc8_unittest.cc", |
| 138 | "lib/financial_ping_test.cc", |
| 139 | "lib/lib_values_unittest.cc", |
| 140 | "lib/machine_id_unittest.cc", |
| 141 | "lib/rlz_lib_test.cc", |
| 142 | "lib/string_utils_unittest.cc", |
| 143 | "test/rlz_unittest_main.cc", |
| 144 | "win/lib/machine_deal_test.cc", |
| 145 | ] |
| 146 | |
| 147 | # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 148 | configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 149 | |
| 150 | deps = [ |
| 151 | ":rlz_lib", |
| 152 | ":rlz_utils", |
| 153 | ":test_support", |
| 154 | "//base", |
Antonio Gomes | a739bf46 | 2018-08-13 20:50:30 | [diff] [blame] | 155 | "//mojo/core/embedder", |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 156 | "//net:test_support", |
Antonio Gomes | a739bf46 | 2018-08-13 20:50:30 | [diff] [blame] | 157 | "//services/network:test_support", |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 158 | "//testing/gmock", |
| 159 | "//testing/gtest", |
| 160 | "//third_party/zlib", |
| 161 | ] |
Wenzhao Zang | c39cff6 | 2018-04-04 21:08:17 | [diff] [blame] | 162 | if (is_chromeos) { |
| 163 | deps += [ "//chromeos" ] |
| 164 | } |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 165 | } |
[email protected] | 2d6893a | 2014-06-02 19:16:36 | [diff] [blame] | 166 | } |
| 167 | |
yusufo | 0979251 | 2017-05-09 06:19:50 | [diff] [blame] | 168 | if (!is_ios && !is_android) { |
sdefresne | 763bbe9 | 2016-03-18 10:30:07 | [diff] [blame] | 169 | executable("rlz_id") { |
| 170 | sources = [ |
| 171 | "examples/rlz_id.cc", |
| 172 | ] |
| 173 | deps = [ |
| 174 | ":rlz_lib", |
brucedawson | f9f7d629 | 2016-04-27 19:11:07 | [diff] [blame] | 175 | "//build/win:default_exe_manifest", |
sdefresne | 763bbe9 | 2016-03-18 10:30:07 | [diff] [blame] | 176 | ] |
| 177 | } |
[email protected] | 2d6893a | 2014-06-02 19:16:36 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | if (is_win) { |
| 181 | shared_library("rlz") { |
| 182 | sources = [ |
| 183 | "win/dll/dll_main.cc", |
| 184 | "win/dll/exports.cc", |
| 185 | ] |
| 186 | deps = [ |
| 187 | ":rlz_lib", |
yusufo | 935ffc1 | 2017-05-05 21:25:15 | [diff] [blame] | 188 | ":rlz_utils", |
[email protected] | 2d6893a | 2014-06-02 19:16:36 | [diff] [blame] | 189 | "//third_party/zlib", |
| 190 | ] |
| 191 | } |
| 192 | } |