blob: 99c82632275e9bcc35669a0f7eabb70884ed20f9 [file] [log] [blame]
[email protected]2d6893a2014-06-02 19:16:361# 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
qsrfb5251d12015-01-21 15:57:228import("//testing/test.gni")
9
[email protected]2d6893a2014-06-02 19:16:3610config("rlz_config") {
11 defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ]
12}
13
yusufo935ffc12017-05-05 21:25:1514source_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
yusufo09792512017-05-09 06:19:5040if (!is_android) {
41 source_set("rlz_lib") {
42 sources = [
yusufo09792512017-05-09 06:19:5043 "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",
yusufo09792512017-05-09 06:19:5052 "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 Gomesa739bf462018-08-13 20:50:3083 "//services/network/public/cpp:cpp",
84 "//services/network/public/mojom",
yusufo09792512017-05-09 06:19:5085 "//url",
86 ]
87
Fabrice de Gans-Riberic15a51a2018-04-20 21:19:0088 if (is_posix) {
89 sources += [
90 "lib/recursive_cross_process_lock_posix.cc",
91 "lib/recursive_cross_process_lock_posix.h",
92 ]
93 }
Wenzhao Zang8242fb62018-03-24 01:40:5194 if (is_chromeos) {
95 deps += [ "//chromeos" ]
96 }
97
yusufo09792512017-05-09 06:19:5098 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 Gomesa739bf462018-08-13 20:50:30126 "//services/network/public/cpp:cpp",
yusufo09792512017-05-09 06:19:50127 "//testing/gtest",
128 ]
Wenzhao Zang8242fb62018-03-24 01:40:51129 if (is_chromeos) {
130 deps += [ "//chromeos" ]
131 }
yusufo09792512017-05-09 06:19:50132 }
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 Gomesa739bf462018-08-13 20:50:30155 "//mojo/core/embedder",
yusufo09792512017-05-09 06:19:50156 "//net:test_support",
Antonio Gomesa739bf462018-08-13 20:50:30157 "//services/network:test_support",
yusufo09792512017-05-09 06:19:50158 "//testing/gmock",
159 "//testing/gtest",
160 "//third_party/zlib",
161 ]
Wenzhao Zangc39cff62018-04-04 21:08:17162 if (is_chromeos) {
163 deps += [ "//chromeos" ]
164 }
yusufo09792512017-05-09 06:19:50165 }
[email protected]2d6893a2014-06-02 19:16:36166}
167
yusufo09792512017-05-09 06:19:50168if (!is_ios && !is_android) {
sdefresne763bbe92016-03-18 10:30:07169 executable("rlz_id") {
170 sources = [
171 "examples/rlz_id.cc",
172 ]
173 deps = [
174 ":rlz_lib",
brucedawsonf9f7d6292016-04-27 19:11:07175 "//build/win:default_exe_manifest",
sdefresne763bbe92016-03-18 10:30:07176 ]
177 }
[email protected]2d6893a2014-06-02 19:16:36178}
179
180if (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",
yusufo935ffc12017-05-05 21:25:15188 ":rlz_utils",
[email protected]2d6893a2014-06-02 19:16:36189 "//third_party/zlib",
190 ]
191 }
192}