OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 # Note that this build file assumes rlz_use_chrome_net which is a condition in | 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. | 6 # the GYP file, but is always true for Chrome builds. |
7 | 7 |
8 import("//testing/test.gni") | 8 import("//testing/test.gni") |
9 | 9 |
10 config("rlz_config") { | 10 config("rlz_config") { |
11 defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ] | 11 defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ] |
12 } | 12 } |
13 | 13 |
14 source_set("rlz_lib") { | |
15 sources = [ | |
16 "chromeos/lib/machine_id_chromeos.cc", | |
17 "chromeos/lib/rlz_value_store_chromeos.cc", | |
18 "chromeos/lib/rlz_value_store_chromeos.h", | |
19 "ios/lib/machine_id_ios.cc", | |
20 "lib/crc8.cc", | |
21 "lib/crc8.h", | |
22 "lib/financial_ping.cc", | |
23 "lib/financial_ping.h", | |
24 "lib/machine_id.cc", | |
25 "lib/machine_id.h", | |
26 "lib/recursive_cross_process_lock_posix.cc", | |
27 "lib/recursive_cross_process_lock_posix.h", | |
28 "lib/rlz_lib.cc", | |
29 "lib/rlz_lib.h", | |
30 "lib/rlz_lib_clear.cc", | |
31 "lib/rlz_value_store.h", | |
32 "mac/lib/machine_id_mac.cc", | |
33 "mac/lib/rlz_value_store_mac.h", | |
34 "mac/lib/rlz_value_store_mac.mm", | |
35 "win/lib/lib_mutex.cc", | |
36 "win/lib/lib_mutex.h", | |
37 "win/lib/machine_deal.cc", | |
38 "win/lib/machine_deal.h", | |
39 "win/lib/machine_id_win.cc", | |
40 "win/lib/process_info.cc", | |
41 "win/lib/process_info.h", | |
42 "win/lib/registry_util.cc", | |
43 "win/lib/registry_util.h", | |
44 "win/lib/rlz_lib_win.cc", | |
45 "win/lib/rlz_value_store_registry.cc", | |
46 "win/lib/rlz_value_store_registry.h", | |
47 ] | |
48 | |
49 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | |
50 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | |
51 | |
52 public_configs = [ ":rlz_config" ] | |
53 | |
54 deps = [ | |
55 ":rlz_utils", | |
56 "//base", | |
57 "//base/third_party/dynamic_annotations", | |
58 "//net", | |
59 "//url", | |
60 ] | |
61 | |
62 if (is_mac) { | |
63 libs = [ | |
64 "Foundation.framework", | |
65 "IOKit.framework", | |
66 ] | |
67 } | |
68 | |
69 if (is_ios) { | |
70 # These _mac files are also used on iOS. | |
71 set_sources_assignment_filter([]) | |
72 sources += [ | |
73 "mac/lib/rlz_value_store_mac.h", | |
74 "mac/lib/rlz_value_store_mac.mm", | |
75 ] | |
76 set_sources_assignment_filter(sources_assignment_filter) | |
77 } | |
78 } | |
79 | |
80 source_set("rlz_utils") { | 14 source_set("rlz_utils") { |
81 sources = [ | 15 sources = [ |
82 "lib/assert.cc", | 16 "lib/assert.cc", |
83 "lib/assert.h", | 17 "lib/assert.h", |
84 "lib/crc32.h", | 18 "lib/crc32.h", |
85 "lib/crc32_wrapper.cc", | 19 "lib/crc32_wrapper.cc", |
86 "lib/lib_values.cc", | 20 "lib/lib_values.cc", |
87 "lib/lib_values.h", | 21 "lib/lib_values.h", |
88 "lib/net_response_check.cc", | 22 "lib/net_response_check.cc", |
89 "lib/net_response_check.h", | 23 "lib/net_response_check.h", |
90 "lib/rlz_api.h", | 24 "lib/rlz_api.h", |
91 "lib/rlz_enums.h", | 25 "lib/rlz_enums.h", |
92 "lib/string_utils.cc", | 26 "lib/string_utils.cc", |
93 "lib/string_utils.h", | 27 "lib/string_utils.h", |
94 ] | 28 ] |
95 | 29 |
96 public_configs = [ ":rlz_config" ] | 30 public_configs = [ ":rlz_config" ] |
97 | 31 |
98 deps = [ | 32 deps = [ |
99 "//base", | 33 "//base", |
100 "//net", | 34 "//net", |
101 "//third_party/zlib", | 35 "//third_party/zlib", |
102 "//url", | 36 "//url", |
103 ] | 37 ] |
104 } | 38 } |
105 | 39 |
106 source_set("test_support") { | 40 if (!is_android) { |
107 testonly = true | 41 source_set("rlz_lib") { |
108 sources = [ | 42 sources = [ |
109 "test/rlz_test_helpers.cc", | 43 "chromeos/lib/machine_id_chromeos.cc", |
110 "test/rlz_test_helpers.h", | 44 "chromeos/lib/rlz_value_store_chromeos.cc", |
111 ] | 45 "chromeos/lib/rlz_value_store_chromeos.h", |
112 deps = [ | 46 "ios/lib/machine_id_ios.cc", |
113 ":rlz_lib", | 47 "lib/crc8.cc", |
114 "//base", | 48 "lib/crc8.h", |
115 "//base/test:test_support", | 49 "lib/financial_ping.cc", |
116 "//testing/gtest", | 50 "lib/financial_ping.h", |
117 ] | 51 "lib/machine_id.cc", |
| 52 "lib/machine_id.h", |
| 53 "lib/recursive_cross_process_lock_posix.cc", |
| 54 "lib/recursive_cross_process_lock_posix.h", |
| 55 "lib/rlz_lib.cc", |
| 56 "lib/rlz_lib.h", |
| 57 "lib/rlz_lib_clear.cc", |
| 58 "lib/rlz_value_store.h", |
| 59 "mac/lib/machine_id_mac.cc", |
| 60 "mac/lib/rlz_value_store_mac.h", |
| 61 "mac/lib/rlz_value_store_mac.mm", |
| 62 "win/lib/lib_mutex.cc", |
| 63 "win/lib/lib_mutex.h", |
| 64 "win/lib/machine_deal.cc", |
| 65 "win/lib/machine_deal.h", |
| 66 "win/lib/machine_id_win.cc", |
| 67 "win/lib/process_info.cc", |
| 68 "win/lib/process_info.h", |
| 69 "win/lib/registry_util.cc", |
| 70 "win/lib/registry_util.h", |
| 71 "win/lib/rlz_lib_win.cc", |
| 72 "win/lib/rlz_value_store_registry.cc", |
| 73 "win/lib/rlz_value_store_registry.h", |
| 74 ] |
| 75 |
| 76 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 77 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 78 |
| 79 public_configs = [ ":rlz_config" ] |
| 80 |
| 81 deps = [ |
| 82 ":rlz_utils", |
| 83 "//base", |
| 84 "//base/third_party/dynamic_annotations", |
| 85 "//net", |
| 86 "//url", |
| 87 ] |
| 88 |
| 89 if (is_mac) { |
| 90 libs = [ |
| 91 "Foundation.framework", |
| 92 "IOKit.framework", |
| 93 ] |
| 94 } |
| 95 |
| 96 if (is_ios) { |
| 97 # These _mac files are also used on iOS. |
| 98 set_sources_assignment_filter([]) |
| 99 sources += [ |
| 100 "mac/lib/rlz_value_store_mac.h", |
| 101 "mac/lib/rlz_value_store_mac.mm", |
| 102 ] |
| 103 set_sources_assignment_filter(sources_assignment_filter) |
| 104 } |
| 105 } |
| 106 |
| 107 source_set("test_support") { |
| 108 testonly = true |
| 109 sources = [ |
| 110 "test/rlz_test_helpers.cc", |
| 111 "test/rlz_test_helpers.h", |
| 112 ] |
| 113 deps = [ |
| 114 ":rlz_lib", |
| 115 "//base", |
| 116 "//base/test:test_support", |
| 117 "//testing/gtest", |
| 118 ] |
| 119 } |
| 120 |
| 121 test("rlz_unittests") { |
| 122 sources = [ |
| 123 "lib/crc32_unittest.cc", |
| 124 "lib/crc8_unittest.cc", |
| 125 "lib/financial_ping_test.cc", |
| 126 "lib/lib_values_unittest.cc", |
| 127 "lib/machine_id_unittest.cc", |
| 128 "lib/rlz_lib_test.cc", |
| 129 "lib/string_utils_unittest.cc", |
| 130 "test/rlz_unittest_main.cc", |
| 131 "win/lib/machine_deal_test.cc", |
| 132 ] |
| 133 |
| 134 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 135 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 136 |
| 137 deps = [ |
| 138 ":rlz_lib", |
| 139 ":rlz_utils", |
| 140 ":test_support", |
| 141 "//base", |
| 142 "//net:test_support", |
| 143 "//testing/gmock", |
| 144 "//testing/gtest", |
| 145 "//third_party/zlib", |
| 146 ] |
| 147 } |
118 } | 148 } |
119 | 149 |
120 test("rlz_unittests") { | 150 if (!is_ios && !is_android) { |
121 sources = [ | |
122 "lib/crc32_unittest.cc", | |
123 "lib/crc8_unittest.cc", | |
124 "lib/financial_ping_test.cc", | |
125 "lib/lib_values_unittest.cc", | |
126 "lib/machine_id_unittest.cc", | |
127 "lib/rlz_lib_test.cc", | |
128 "lib/string_utils_unittest.cc", | |
129 "test/rlz_unittest_main.cc", | |
130 "win/lib/machine_deal_test.cc", | |
131 ] | |
132 | |
133 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | |
134 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | |
135 | |
136 deps = [ | |
137 ":rlz_lib", | |
138 ":rlz_utils", | |
139 ":test_support", | |
140 "//base", | |
141 "//net:test_support", | |
142 "//testing/gmock", | |
143 "//testing/gtest", | |
144 "//third_party/zlib", | |
145 ] | |
146 } | |
147 | |
148 if (!is_ios) { | |
149 executable("rlz_id") { | 151 executable("rlz_id") { |
150 sources = [ | 152 sources = [ |
151 "examples/rlz_id.cc", | 153 "examples/rlz_id.cc", |
152 ] | 154 ] |
153 deps = [ | 155 deps = [ |
154 ":rlz_lib", | 156 ":rlz_lib", |
155 "//build/config/sanitizers:deps", | 157 "//build/config/sanitizers:deps", |
156 "//build/win:default_exe_manifest", | 158 "//build/win:default_exe_manifest", |
157 ] | 159 ] |
158 } | 160 } |
159 } | 161 } |
160 | 162 |
161 if (is_win) { | 163 if (is_win) { |
162 shared_library("rlz") { | 164 shared_library("rlz") { |
163 sources = [ | 165 sources = [ |
164 "win/dll/dll_main.cc", | 166 "win/dll/dll_main.cc", |
165 "win/dll/exports.cc", | 167 "win/dll/exports.cc", |
166 ] | 168 ] |
167 deps = [ | 169 deps = [ |
168 ":rlz_lib", | 170 ":rlz_lib", |
169 ":rlz_utils", | 171 ":rlz_utils", |
170 "//build/config/sanitizers:deps", | 172 "//build/config/sanitizers:deps", |
171 "//third_party/zlib", | 173 "//third_party/zlib", |
172 ] | 174 ] |
173 } | 175 } |
174 } | 176 } |
OLD | NEW |