Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / rlz / BUILD.gn
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
8 config("rlz_config") {
9   defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ]
10 }
11
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   ]
55
56   public_configs = [ ":rlz_config" ]
57
58   deps = [
59     "//base",
60     "//base/third_party/dynamic_annotations",
61     "//net",
62   ]
63
64   if (is_ios) {
65     # These _mac files are also used on iOS.
66     set_sources_assignment_filter([])
67     sources += [
68       "mac/lib/rlz_value_store_mac.mm",
69       "mac/lib/rlz_value_store_mac.h",
70     ]
71     set_sources_assignment_filter(sources_assignment_filter)
72   } else if (is_win) {
73     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
74     cflags = [ "/wd4267" ]
75   }
76 }
77
78 source_set("test_support") {
79   testonly = true
80   sources = [
81     "test/rlz_test_helpers.cc",
82     "test/rlz_test_helpers.h",
83   ]
84   deps = [
85     ":rlz_lib",
86     "//base",
87     "//base/test:test_support",
88     "//testing/gtest",
89   ]
90 }
91
92 test("rlz_unittests") {
93   sources = [
94     "lib/crc32_unittest.cc",
95     "lib/crc8_unittest.cc",
96     "lib/financial_ping_test.cc",
97     "lib/lib_values_unittest.cc",
98     "lib/machine_id_unittest.cc",
99     "lib/rlz_lib_test.cc",
100     "lib/string_utils_unittest.cc",
101     "test/rlz_unittest_main.cc",
102     "win/lib/machine_deal_test.cc",
103   ]
104
105   deps = [
106     ":rlz_lib",
107     ":test_support",
108     "//base",
109     "//base:prefs",
110     "//net:test_support",
111     "//testing/gmock",
112     "//testing/gtest",
113     "//third_party/zlib",
114   ]
115 }
116
117 executable("rlz_id") {
118   sources = [
119     "examples/rlz_id.cc",
120   ]
121   deps = [
122     ":rlz_lib",
123   ]
124 }
125
126 if (is_win) {
127   shared_library("rlz") {
128     sources = [
129       "win/dll/dll_main.cc",
130       "win/dll/exports.cc",
131     ]
132     deps = [
133       ":rlz_lib",
134       "//third_party/zlib",
135     ]
136   }
137 }