blob: c9c02d7521797a85c0175eef209f5d0d9ab5c38b [file] [log] [blame]
Liam McLoughlin3ebadf82013-01-01 22:32:25 -05001{
2 'target_defaults': {
Ben Chan2e6543d2014-02-05 23:26:25 -08003 'variables': {
4 'deps': [
5 'dbus-1',
Alex Vakulenko26aef372015-10-27 11:46:37 -07006 'libbrillo-<(libbase_ver)',
Ben Chan2e6543d2014-02-05 23:26:25 -08007 'libchrome-<(libbase_ver)',
8 ]
9 },
10 'cflags_cc': [
11 '-fno-exceptions',
12 ],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050013 },
14 'targets': [
15 {
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050016 'target_name': 'libmetrics_daemon',
17 'type': 'static_library',
Ben Chan2e6543d2014-02-05 23:26:25 -080018 'dependencies': [
19 '../metrics/libmetrics-<(libbase_ver).gyp:libmetrics-<(libbase_ver)',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070020 'libupload_service',
21 'metrics_proto',
Ben Chan2e6543d2014-02-05 23:26:25 -080022 ],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050023 'link_settings': {
24 'libraries': [
25 '-lrootdev',
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050026 ],
27 },
28 'sources': [
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -080029 'persistent_integer.cc',
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050030 'metrics_daemon.cc',
31 'metrics_daemon_main.cc',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070032 ],
33 'include_dirs': ['.'],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050034 },
35 {
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050036 'target_name': 'metrics_client',
37 'type': 'executable',
Ben Chan2e6543d2014-02-05 23:26:25 -080038 'dependencies': [
39 '../metrics/libmetrics-<(libbase_ver).gyp:libmetrics-<(libbase_ver)',
40 ],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050041 'sources': [
42 'metrics_client.cc',
43 ]
44 },
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070045 {
46 'target_name': 'libupload_service',
47 'type': 'static_library',
48 'dependencies': [
Bertrand SIMONNETd83ca802014-07-09 16:34:29 -070049 'metrics_proto',
50 '../metrics/libmetrics-<(libbase_ver).gyp:libmetrics-<(libbase_ver)',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070051 ],
52 'link_settings': {
53 'libraries': [
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070054 '-lvboot_host',
55 ],
56 },
57 'variables': {
58 'exported_deps': [
59 'protobuf-lite',
60 ],
61 'deps': [
62 '<@(exported_deps)',
63 ],
64 },
65 'all_dependent_settings': {
66 'variables': {
67 'deps+': [
68 '<@(exported_deps)',
69 ],
70 },
71 },
72 'sources': [
73 'uploader/upload_service.cc',
Alex Vakulenko788d3b62014-12-11 09:48:46 -080074 'uploader/metrics_hashes.cc',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070075 'uploader/metrics_log.cc',
Alex Vakulenko788d3b62014-12-11 09:48:46 -080076 'uploader/metrics_log_base.cc',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070077 'uploader/system_profile_cache.cc',
Alex Vakulenkoec991df2014-09-04 16:16:28 -070078 'uploader/sender_http.cc',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070079 ],
80 'include_dirs': ['.']
81 },
82 {
83 'target_name': 'metrics_proto',
84 'type': 'static_library',
85 'variables': {
Bertrand SIMONNETc95440e2015-07-16 17:16:51 -070086 'proto_in_dir': 'uploader/proto',
87 'proto_out_dir': 'include/metrics/uploader/proto',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070088 },
89 'sources': [
90 '<(proto_in_dir)/chrome_user_metrics_extension.proto',
91 '<(proto_in_dir)/histogram_event.proto',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070092 '<(proto_in_dir)/system_profile.proto',
93 '<(proto_in_dir)/user_action_event.proto',
94 ],
95 'includes': [
Alex Deymodfea2f82014-09-24 11:09:43 -070096 '../common-mk/protoc.gypi'
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070097 ],
98 },
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050099 ],
100 'conditions': [
Chris Masone33a1bae2013-11-18 14:35:09 -0800101 ['USE_passive_metrics == 1', {
102 'targets': [
103 {
104 'target_name': 'metrics_daemon',
105 'type': 'executable',
106 'dependencies': ['libmetrics_daemon'],
107 },
108 ],
109 }],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500110 ['USE_test == 1', {
111 'targets': [
112 {
Luigi Semenzato6c320062014-03-14 14:17:52 -0700113 'target_name': 'persistent_integer_test',
114 'type': 'executable',
Alex Deymodfea2f82014-09-24 11:09:43 -0700115 'includes': ['../common-mk/common_test.gypi'],
Luigi Semenzato6c320062014-03-14 14:17:52 -0700116 'sources': [
117 'persistent_integer.cc',
118 'persistent_integer_test.cc',
119 ]
120 },
121 {
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500122 'target_name': 'metrics_library_test',
123 'type': 'executable',
Ben Chan2e6543d2014-02-05 23:26:25 -0800124 'dependencies': [
125 '../metrics/libmetrics-<(libbase_ver).gyp:libmetrics-<(libbase_ver)',
126 ],
Alex Deymodfea2f82014-09-24 11:09:43 -0700127 'includes': ['../common-mk/common_test.gypi'],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500128 'sources': [
129 'metrics_library_test.cc',
Alex Vakulenko788d3b62014-12-11 09:48:46 -0800130 'serialization/serialization_utils_unittest.cc',
Bertrand SIMONNET4764f522014-06-04 13:08:52 -0700131 ],
132 'link_settings': {
133 'libraries': [
134 '-lpolicy-<(libbase_ver)',
135 ]
136 }
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500137 },
138 {
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500139 'target_name': 'timer_test',
140 'type': 'executable',
Alex Deymodfea2f82014-09-24 11:09:43 -0700141 'includes': ['../common-mk/common_test.gypi'],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500142 'sources': [
143 'timer.cc',
144 'timer_test.cc',
145 ]
146 },
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -0700147 {
148 'target_name': 'upload_service_test',
149 'type': 'executable',
150 'sources': [
151 'persistent_integer.cc',
Alex Vakulenko788d3b62014-12-11 09:48:46 -0800152 'uploader/metrics_hashes_unittest.cc',
153 'uploader/metrics_log_base_unittest.cc',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -0700154 'uploader/mock/sender_mock.cc',
155 'uploader/upload_service_test.cc',
156 ],
157 'dependencies': [
158 'libupload_service',
159 ],
160 'includes':[
Alex Deymodfea2f82014-09-24 11:09:43 -0700161 '../common-mk/common_test.gypi',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -0700162 ],
163 'include_dirs': ['.']
164 },
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500165 ],
166 }],
Chris Masone33a1bae2013-11-18 14:35:09 -0800167 ['USE_passive_metrics == 1 and USE_test == 1', {
168 'targets': [
169 {
170 'target_name': 'metrics_daemon_test',
171 'type': 'executable',
172 'dependencies': [
173 'libmetrics_daemon',
174 ],
Alex Deymodfea2f82014-09-24 11:09:43 -0700175 'includes': ['../common-mk/common_test.gypi'],
Chris Masone33a1bae2013-11-18 14:35:09 -0800176 'sources': [
177 'metrics_daemon_test.cc',
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -0700178 ],
179 'include_dirs': ['.'],
Chris Masone33a1bae2013-11-18 14:35:09 -0800180 },
181 ],
182 }],
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -0700183 ]
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500184}