1{ 2 'target_defaults': { 3 'variables': { 4 'deps': [ 5 'dbus-1', 6 'libbrillo-<(libbase_ver)', 7 'libchrome-<(libbase_ver)', 8 ] 9 }, 10 'cflags_cc': [ 11 '-fno-exceptions', 12 ], 13 }, 14 'targets': [ 15 { 16 'target_name': 'libmetrics_daemon', 17 'type': 'static_library', 18 'dependencies': [ 19 '../metrics/libmetrics-<(libbase_ver).gyp:libmetrics-<(libbase_ver)', 20 'libupload_service', 21 'metrics_proto', 22 ], 23 'link_settings': { 24 'libraries': [ 25 '-lrootdev', 26 ], 27 }, 28 'sources': [ 29 'persistent_integer.cc', 30 'metrics_daemon.cc', 31 'metrics_daemon_main.cc', 32 ], 33 'include_dirs': ['.'], 34 }, 35 { 36 'target_name': 'metrics_client', 37 'type': 'executable', 38 'dependencies': [ 39 '../metrics/libmetrics-<(libbase_ver).gyp:libmetrics-<(libbase_ver)', 40 ], 41 'sources': [ 42 'metrics_client.cc', 43 ] 44 }, 45 { 46 'target_name': 'libupload_service', 47 'type': 'static_library', 48 'dependencies': [ 49 'metrics_proto', 50 '../metrics/libmetrics-<(libbase_ver).gyp:libmetrics-<(libbase_ver)', 51 ], 52 'link_settings': { 53 'libraries': [ 54 '-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', 74 'uploader/metrics_hashes.cc', 75 'uploader/metrics_log.cc', 76 'uploader/metrics_log_base.cc', 77 'uploader/system_profile_cache.cc', 78 'uploader/sender_http.cc', 79 ], 80 'include_dirs': ['.'] 81 }, 82 { 83 'target_name': 'metrics_proto', 84 'type': 'static_library', 85 'variables': { 86 'proto_in_dir': 'uploader/proto', 87 'proto_out_dir': 'include/metrics/uploader/proto', 88 }, 89 'sources': [ 90 '<(proto_in_dir)/chrome_user_metrics_extension.proto', 91 '<(proto_in_dir)/histogram_event.proto', 92 '<(proto_in_dir)/system_profile.proto', 93 '<(proto_in_dir)/user_action_event.proto', 94 ], 95 'includes': [ 96 '../common-mk/protoc.gypi' 97 ], 98 }, 99 ], 100 'conditions': [ 101 ['USE_passive_metrics == 1', { 102 'targets': [ 103 { 104 'target_name': 'metrics_daemon', 105 'type': 'executable', 106 'dependencies': ['libmetrics_daemon'], 107 }, 108 ], 109 }], 110 ['USE_test == 1', { 111 'targets': [ 112 { 113 'target_name': 'persistent_integer_test', 114 'type': 'executable', 115 'includes': ['../common-mk/common_test.gypi'], 116 'sources': [ 117 'persistent_integer.cc', 118 'persistent_integer_test.cc', 119 ] 120 }, 121 { 122 'target_name': 'metrics_library_test', 123 'type': 'executable', 124 'dependencies': [ 125 '../metrics/libmetrics-<(libbase_ver).gyp:libmetrics-<(libbase_ver)', 126 ], 127 'includes': ['../common-mk/common_test.gypi'], 128 'sources': [ 129 'metrics_library_test.cc', 130 'serialization/serialization_utils_unittest.cc', 131 ], 132 'link_settings': { 133 'libraries': [ 134 '-lpolicy-<(libbase_ver)', 135 ] 136 } 137 }, 138 { 139 'target_name': 'timer_test', 140 'type': 'executable', 141 'includes': ['../common-mk/common_test.gypi'], 142 'sources': [ 143 'timer.cc', 144 'timer_test.cc', 145 ] 146 }, 147 { 148 'target_name': 'upload_service_test', 149 'type': 'executable', 150 'sources': [ 151 'persistent_integer.cc', 152 'uploader/metrics_hashes_unittest.cc', 153 'uploader/metrics_log_base_unittest.cc', 154 'uploader/mock/sender_mock.cc', 155 'uploader/upload_service_test.cc', 156 ], 157 'dependencies': [ 158 'libupload_service', 159 ], 160 'includes':[ 161 '../common-mk/common_test.gypi', 162 ], 163 'include_dirs': ['.'] 164 }, 165 ], 166 }], 167 ['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 ], 175 'includes': ['../common-mk/common_test.gypi'], 176 'sources': [ 177 'metrics_daemon_test.cc', 178 ], 179 'include_dirs': ['.'], 180 }, 181 ], 182 }], 183 ] 184} 185