blob: 9709c35b3fc56f0b8acf78784af0565860a5492a [file] [log] [blame]
Liam McLoughlin3ebadf82013-01-01 22:32:25 -05001{
2 'target_defaults': {
3 'dependencies': [
4 '../libchromeos/libchromeos-<(libbase_ver).gyp:libchromeos-<(libbase_ver)',
5 ],
6 'variables': {
7 'deps': [
8 'dbus-1',
9 'dbus-glib-1',
10 'glib-2.0',
11 'gobject-2.0',
12 'gthread-2.0',
13 'libchrome-<(libbase_ver)',
14 ]
15 },
16 'cflags_cc': [
17 '-fno-exceptions',
18 ],
19 },
20 'targets': [
21 {
22 'target_name': 'metrics',
23 'type': 'static_library',
24 'sources': [
25 'c_metrics_library.cc',
26 'metrics_library.cc',
27 'timer.cc',
28 ],
29 },
30 {
31 'target_name': 'libmetrics',
32 'type': 'shared_library',
Liam McLoughlinb2c56e12013-11-05 20:58:18 +000033 'cflags': [
34 '-fvisibility=default',
35 ],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050036 'sources': [
37 'c_metrics_library.cc',
38 'metrics_library.cc',
39 'timer.cc',
40 ],
41 },
42 {
43 'target_name': 'libmetrics_daemon',
44 'type': 'static_library',
45 'dependencies': ['libmetrics'],
46 'link_settings': {
47 'libraries': [
48 '-lrootdev',
49 '-lgflags',
50 ],
51 },
52 'sources': [
53 'counter.cc',
54 'metrics_daemon.cc',
55 'metrics_daemon_main.cc',
56 ]
57 },
58 {
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050059 'target_name': 'metrics_client',
60 'type': 'executable',
61 'dependencies': ['libmetrics'],
62 'sources': [
63 'metrics_client.cc',
64 ]
65 },
66 ],
67 'conditions': [
Chris Masone33a1bae2013-11-18 14:35:09 -080068 ['USE_passive_metrics == 1', {
69 'targets': [
70 {
71 'target_name': 'metrics_daemon',
72 'type': 'executable',
73 'dependencies': ['libmetrics_daemon'],
74 },
75 ],
76 }],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050077 ['USE_test == 1', {
78 'targets': [
79 {
80 'target_name': 'metrics_library_test',
81 'type': 'executable',
82 'dependencies': ['libmetrics'],
83 'includes': ['../common-mk/common_test.gypi'],
84 'sources': [
85 'metrics_library_test.cc',
86 ]
87 },
88 {
Liam McLoughlin3ebadf82013-01-01 22:32:25 -050089 'target_name': 'counter_test',
90 'type': 'executable',
91 'includes': ['../common-mk/common_test.gypi'],
92 'sources': [
93 'counter.cc',
94 'counter_test.cc',
95 ]
96 },
97 {
98 'target_name': 'timer_test',
99 'type': 'executable',
100 'includes': ['../common-mk/common_test.gypi'],
101 'sources': [
102 'timer.cc',
103 'timer_test.cc',
104 ]
105 },
106 ],
107 }],
Chris Masone33a1bae2013-11-18 14:35:09 -0800108 ['USE_passive_metrics == 1 and USE_test == 1', {
109 'targets': [
110 {
111 'target_name': 'metrics_daemon_test',
112 'type': 'executable',
113 'dependencies': [
114 'libmetrics_daemon',
115 ],
116 'includes': ['../common-mk/common_test.gypi'],
117 'sources': [
118 'metrics_daemon_test.cc',
119 ]
120 },
121 ],
122 }],
Liam McLoughlin3ebadf82013-01-01 22:32:25 -0500123 ],
124}