Upload upstream chromium 120.0.6099.5
[platform/framework/web/chromium-efl.git] / rlz / BUILD.gn
1 # Copyright 2014 The Chromium Authors
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
8 import("//build/config/chromeos/ui_mode.gni")
9 import("//rlz/buildflags/buildflags.gni")
10 import("//testing/test.gni")
11
12 source_set("rlz_utils") {
13   sources = [
14     "lib/assert.cc",
15     "lib/assert.h",
16     "lib/crc32.h",
17     "lib/crc32_wrapper.cc",
18     "lib/lib_values.cc",
19     "lib/lib_values.h",
20     "lib/net_response_check.cc",
21     "lib/net_response_check.h",
22     "lib/rlz_api.h",
23     "lib/rlz_enums.h",
24     "lib/string_utils.cc",
25     "lib/string_utils.h",
26   ]
27
28   public_deps = [ "//base" ]
29
30   deps = [
31     "//build:chromeos_buildflags",
32     "//third_party/zlib",
33   ]
34 }
35
36 if (enable_rlz_support) {
37   source_set("rlz_lib_no_network") {
38     sources = [
39       "lib/crc8.cc",
40       "lib/crc8.h",
41       "lib/machine_deal_win.h",
42       "lib/machine_id.cc",
43       "lib/machine_id.h",
44       "lib/rlz_lib_clear.cc",
45       "lib/rlz_lib_clear.h",
46       "lib/rlz_value_store.h",
47       "lib/supplementary_branding.cc",
48       "lib/supplementary_branding.h",
49       "lib/time_util.h",
50     ]
51
52     if (is_win) {
53       sources += [
54         "lib/time_util_win.cc",
55         "win/lib/lib_mutex.cc",
56         "win/lib/lib_mutex.h",
57         "win/lib/machine_deal.cc",
58         "win/lib/machine_deal.h",
59         "win/lib/machine_id_win.cc",
60         "win/lib/process_info.cc",
61         "win/lib/process_info.h",
62         "win/lib/registry_util.cc",
63         "win/lib/registry_util.h",
64         "win/lib/rlz_lib_win.cc",
65         "win/lib/rlz_value_store_registry.cc",
66         "win/lib/rlz_value_store_registry.h",
67       ]
68     } else {
69       sources += [ "lib/time_util_base.cc" ]
70     }
71
72     deps = [
73       ":rlz_utils",
74       "//base",
75       "//build:chromeos_buildflags",
76     ]
77
78     if (is_chromeos_ash) {
79       sources += [
80         "chromeos/lib/rlz_value_store_chromeos.cc",
81         "chromeos/lib/rlz_value_store_chromeos.h",
82       ]
83       deps += [
84         "//chromeos/ash/components/dbus",
85         "//chromeos/ash/components/dbus/debug_daemon",
86         "//chromeos/ash/components/system",
87       ]
88     }
89
90     if (is_apple) {
91       sources += [
92         "mac/lib/rlz_value_store_mac.h",
93         "mac/lib/rlz_value_store_mac.mm",
94       ]
95
96       frameworks = [ "Foundation.framework" ]
97
98       if (is_mac) {
99         sources += [ "mac/lib/machine_id_mac.cc" ]
100         frameworks += [ "IOKit.framework" ]
101       }
102
103       if (is_ios) {
104         sources += [ "ios/lib/machine_id_ios.cc" ]
105       }
106     }
107
108     if (is_posix) {
109       sources += [
110         "lib/recursive_cross_process_lock_posix.cc",
111         "lib/recursive_cross_process_lock_posix.h",
112       ]
113     }
114   }
115
116   source_set("rlz_lib") {
117     sources = [
118       "lib/financial_ping.cc",
119       "lib/financial_ping.h",
120       "lib/rlz_lib.cc",
121       "lib/rlz_lib.h",
122     ]
123
124     public_deps = [
125       ":rlz_lib_no_network",
126       "//base",
127     ]
128
129     deps = [
130       ":rlz_utils",
131       "//base/third_party/dynamic_annotations",
132       "//build:chromeos_buildflags",
133       "//net",
134       "//services/network/public/cpp:cpp",
135       "//services/network/public/mojom",
136       "//url",
137     ]
138
139     if (is_chromeos_ash) {
140       deps += [
141         "//chromeos/ash/components/dbus",
142         "//chromeos/ash/components/system",
143       ]
144     }
145   }
146
147   source_set("test_support") {
148     testonly = true
149     sources = [
150       "test/rlz_test_helpers.cc",
151       "test/rlz_test_helpers.h",
152     ]
153     public_deps = [
154       "//base",
155       "//base/test:test_support",
156       "//testing/gtest",
157     ]
158     deps = [
159       ":rlz_lib",
160       "//build:chromeos_buildflags",
161     ]
162     if (is_chromeos_ash) {
163       public_deps += [ "//chromeos/ash/components/system" ]
164     }
165   }
166
167   test("rlz_unittests") {
168     sources = [
169       "lib/crc32_unittest.cc",
170       "lib/crc8_unittest.cc",
171       "lib/financial_ping_test.cc",
172       "lib/lib_values_unittest.cc",
173       "lib/machine_id_unittest.cc",
174       "lib/rlz_lib_test.cc",
175       "lib/string_utils_unittest.cc",
176       "test/rlz_unittest_main.cc",
177     ]
178
179     if (is_win) {
180       sources += [ "win/lib/machine_deal_test.cc" ]
181     }
182
183     deps = [
184       ":rlz_lib",
185       ":rlz_utils",
186       ":test_support",
187       "//base",
188       "//build:chromeos_buildflags",
189       "//mojo/core/embedder",
190       "//net:test_support",
191       "//services/network:test_support",
192       "//testing/gmock",
193       "//testing/gtest",
194       "//third_party/zlib",
195     ]
196     if (is_chromeos_ash) {
197       deps += [
198         "//chromeos/ash/components/dbus:test_support",
199         "//chromeos/ash/components/dbus/debug_daemon",
200         "//chromeos/ash/components/system",
201       ]
202     }
203   }
204 }
205
206 if (!is_ios && !is_android) {
207   executable("rlz_id") {
208     sources = [ "examples/rlz_id.cc" ]
209     deps = [
210       ":rlz_lib",
211       "//build/win:default_exe_manifest",
212     ]
213   }
214 }