Fix FilesystemUtils.SourceDirForPath after r306368
[chromium-blink-merge.git] / rlz / BUILD.gn
blob0887ef4726a3d8ab64e91a8df8a2de5c01395bfd
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.
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.
8 config("rlz_config") {
9   defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ]
12 source_set("rlz_lib") {
13   sources = [
14     "chromeos/lib/machine_id_chromeos.cc",
15     "chromeos/lib/rlz_value_store_chromeos.cc",
16     "chromeos/lib/rlz_value_store_chromeos.h",
17     "ios/lib/machine_id_ios.cc",
18     "lib/assert.cc",
19     "lib/assert.h",
20     "lib/crc32.h",
21     "lib/crc32_wrapper.cc",
22     "lib/crc8.h",
23     "lib/crc8.cc",
24     "lib/financial_ping.cc",
25     "lib/financial_ping.h",
26     "lib/lib_values.cc",
27     "lib/machine_id.cc",
28     "lib/machine_id.h",
29     "lib/recursive_cross_process_lock_posix.cc",
30     "lib/recursive_cross_process_lock_posix.h",
31     "lib/rlz_enums.h",
32     "lib/rlz_lib.cc",
33     "lib/rlz_lib.h",
34     "lib/rlz_lib_clear.cc",
35     "lib/lib_values.h",
36     "lib/rlz_value_store.h",
37     "lib/string_utils.cc",
38     "lib/string_utils.h",
39     "mac/lib/machine_id_mac.cc",
40     "mac/lib/rlz_value_store_mac.mm",
41     "mac/lib/rlz_value_store_mac.h",
42     "win/lib/lib_mutex.cc",
43     "win/lib/lib_mutex.h",
44     "win/lib/machine_deal.cc",
45     "win/lib/machine_deal.h",
46     "win/lib/machine_id_win.cc",
47     "win/lib/process_info.cc",
48     "win/lib/process_info.h",
49     "win/lib/registry_util.cc",
50     "win/lib/registry_util.h",
51     "win/lib/rlz_lib_win.cc",
52     "win/lib/rlz_value_store_registry.cc",
53     "win/lib/rlz_value_store_registry.h",
54   ]
56   public_configs = [ ":rlz_config" ]
58   deps = [
59     "//base",
60     "//base/third_party/dynamic_annotations",
61     "//net",
62     "//third_party/zlib",
63     "//url",
64   ]
66   if (is_ios) {
67     # These _mac files are also used on iOS.
68     set_sources_assignment_filter([])
69     sources += [
70       "mac/lib/rlz_value_store_mac.mm",
71       "mac/lib/rlz_value_store_mac.h",
72     ]
73     set_sources_assignment_filter(sources_assignment_filter)
74   } else if (is_win) {
75     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
76     cflags = [ "/wd4267" ]
77   }
80 source_set("test_support") {
81   testonly = true
82   sources = [
83     "test/rlz_test_helpers.cc",
84     "test/rlz_test_helpers.h",
85   ]
86   deps = [
87     ":rlz_lib",
88     "//base",
89     "//base/test:test_support",
90     "//testing/gtest",
91   ]
94 test("rlz_unittests") {
95   sources = [
96     "lib/crc32_unittest.cc",
97     "lib/crc8_unittest.cc",
98     "lib/financial_ping_test.cc",
99     "lib/lib_values_unittest.cc",
100     "lib/machine_id_unittest.cc",
101     "lib/rlz_lib_test.cc",
102     "lib/string_utils_unittest.cc",
103     "test/rlz_unittest_main.cc",
104     "win/lib/machine_deal_test.cc",
105   ]
107   deps = [
108     ":rlz_lib",
109     ":test_support",
110     "//base",
111     "//base:prefs",
112     "//net:test_support",
113     "//testing/gmock",
114     "//testing/gtest",
115     "//third_party/zlib",
116   ]
118   if (is_win) {
119     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
120     cflags = [ "/wd4267" ]
121   }
124 executable("rlz_id") {
125   sources = [
126     "examples/rlz_id.cc",
127   ]
128   deps = [
129     ":rlz_lib",
130   ]
133 if (is_win) {
134   shared_library("rlz") {
135     sources = [
136       "win/dll/dll_main.cc",
137       "win/dll/exports.cc",
138     ]
139     deps = [
140       ":rlz_lib",
141       "//third_party/zlib",
142     ]
143   }