Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 1 | { |
| 2 | 'target_defaults': { |
| 3 | 'variables': { |
| 4 | 'deps': [ |
| 5 | 'libchrome-<(libbase_ver)', |
| 6 | 'libchromeos-<(libbase_ver)', |
| 7 | ], |
| 8 | # Defaults if the -DUSE_* flags are not passed to gyp is 0. You can set |
| 9 | # the default value for the USE flag in the ebuild. |
| 10 | 'USE_hwid_override%': '0', |
| 11 | 'USE_power_management%': '0', |
| 12 | }, |
| 13 | 'cflags': [ |
| 14 | '-g', |
| 15 | '-ffunction-sections', |
| 16 | '-Wall', |
| 17 | '-Wextra', |
| 18 | '-Werror', |
| 19 | '-Wno-unused-parameter', |
| 20 | '-Wno-deprecated-register', |
| 21 | ], |
| 22 | 'cflags_cc': [ |
| 23 | '-fno-strict-aliasing', |
Nam T. Nguyen | fc144e6 | 2014-12-03 09:50:49 -0800 | [diff] [blame^] | 24 | '-Wnon-virtual-dtor', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 25 | ], |
| 26 | 'ldflags': [ |
| 27 | '-Wl,--gc-sections', |
| 28 | ], |
| 29 | 'defines': [ |
| 30 | '__STDC_FORMAT_MACROS=1', |
| 31 | '_FILE_OFFSET_BITS=64', |
| 32 | '_POSIX_C_SOURCE=199309L', |
| 33 | 'USE_HWID_OVERRIDE=<(USE_hwid_override)', |
| 34 | 'USE_POWER_MANAGEMENT=<(USE_power_management)', |
| 35 | ], |
| 36 | }, |
| 37 | 'targets': [ |
| 38 | # Protobufs. |
| 39 | { |
| 40 | 'target_name': 'update_metadata-protos', |
| 41 | 'type': 'static_library', |
| 42 | 'variables': { |
| 43 | 'proto_in_dir': '.', |
| 44 | 'proto_out_dir': 'include/update_engine', |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 45 | 'exported_deps': [ |
Alex Deymo | b8f16a1 | 2014-06-10 18:59:22 -0700 | [diff] [blame] | 46 | 'protobuf-lite', |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 47 | ], |
| 48 | 'deps': ['<@(exported_deps)'], |
| 49 | }, |
| 50 | 'all_dependent_settings': { |
| 51 | 'variables': { |
| 52 | 'deps': [ |
| 53 | '<@(exported_deps)', |
| 54 | ], |
| 55 | }, |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 56 | }, |
| 57 | 'sources': [ |
| 58 | 'update_metadata.proto' |
| 59 | ], |
| 60 | 'includes': ['../common-mk/protoc.gypi'], |
| 61 | }, |
| 62 | # D-Bus glib bindings. |
| 63 | { |
| 64 | 'target_name': 'update_engine-dbus-client', |
| 65 | 'type': 'none', |
| 66 | 'variables': { |
| 67 | 'dbus_glib_type': 'client', |
| 68 | 'dbus_glib_out_dir': 'include/update_engine', |
| 69 | 'dbus_glib_prefix': 'update_engine_service', |
| 70 | }, |
| 71 | 'sources': [ |
| 72 | 'update_engine.xml', |
| 73 | ], |
| 74 | 'includes': ['../common-mk/dbus_glib.gypi'], |
| 75 | }, |
| 76 | { |
| 77 | 'target_name': 'update_engine-dbus-server', |
| 78 | 'type': 'none', |
| 79 | 'variables': { |
| 80 | 'dbus_glib_type': 'server', |
| 81 | 'dbus_glib_out_dir': 'include/update_engine', |
| 82 | 'dbus_glib_prefix': 'update_engine_service', |
| 83 | }, |
| 84 | 'sources': [ |
| 85 | 'update_engine.xml', |
| 86 | ], |
| 87 | 'includes': ['../common-mk/dbus_glib.gypi'], |
| 88 | }, |
| 89 | # The main static_library with all the code. |
| 90 | { |
| 91 | 'target_name': 'libupdate_engine', |
| 92 | 'type': 'static_library', |
| 93 | 'dependencies': [ |
| 94 | 'update_metadata-protos', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 95 | ], |
| 96 | 'variables': { |
| 97 | 'exported_deps': [ |
| 98 | 'dbus-1', |
| 99 | 'dbus-glib-1', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 100 | 'gio-2.0', |
| 101 | 'gio-unix-2.0', |
| 102 | 'glib-2.0', |
| 103 | 'gthread-2.0', |
| 104 | 'libchrome-<(libbase_ver)', |
| 105 | 'libchromeos-<(libbase_ver)', |
| 106 | 'libcrypto', |
| 107 | 'libcurl', |
| 108 | 'libmetrics-<(libbase_ver)', |
| 109 | 'libssl', |
David Zeuthen | e8ed863 | 2014-07-24 13:38:10 -0400 | [diff] [blame] | 110 | 'expat' |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 111 | ], |
| 112 | 'deps': ['<@(exported_deps)'], |
| 113 | }, |
| 114 | 'all_dependent_settings': { |
| 115 | 'variables': { |
| 116 | 'deps': [ |
| 117 | '<@(exported_deps)', |
| 118 | ], |
| 119 | }, |
| 120 | }, |
| 121 | 'link_settings': { |
| 122 | 'variables': { |
| 123 | 'deps': [ |
| 124 | '<@(exported_deps)', |
| 125 | ], |
| 126 | }, |
| 127 | 'libraries': [ |
| 128 | '-lbz2', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 129 | '-lpolicy-<(libbase_ver)', |
| 130 | '-lrootdev', |
| 131 | '-lrt', |
| 132 | '-lvboot_host', |
| 133 | ], |
| 134 | }, |
| 135 | 'sources': [ |
| 136 | 'action_processor.cc', |
| 137 | 'bzip.cc', |
| 138 | 'bzip_extent_writer.cc', |
| 139 | 'certificate_checker.cc', |
| 140 | 'chrome_browser_proxy_resolver.cc', |
| 141 | 'clock.cc', |
| 142 | 'connection_manager.cc', |
| 143 | 'constants.cc', |
| 144 | 'dbus_service.cc', |
| 145 | 'delta_performer.cc', |
| 146 | 'download_action.cc', |
| 147 | 'extent_ranges.cc', |
| 148 | 'extent_writer.cc', |
| 149 | 'file_descriptor.cc', |
| 150 | 'file_writer.cc', |
| 151 | 'filesystem_copier_action.cc', |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame] | 152 | 'glib_utils.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 153 | 'hardware.cc', |
| 154 | 'http_common.cc', |
| 155 | 'http_fetcher.cc', |
| 156 | 'hwid_override.cc', |
| 157 | 'install_plan.cc', |
| 158 | 'libcurl_http_fetcher.cc', |
| 159 | 'metrics.cc', |
| 160 | 'multi_range_http_fetcher.cc', |
| 161 | 'omaha_hash_calculator.cc', |
| 162 | 'omaha_request_action.cc', |
| 163 | 'omaha_request_params.cc', |
| 164 | 'omaha_response_handler_action.cc', |
| 165 | 'p2p_manager.cc', |
| 166 | 'payload_constants.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 167 | 'payload_state.cc', |
Alex Deymo | 923d8fa | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 168 | 'payload_verifier.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 169 | 'postinstall_runner_action.cc', |
| 170 | 'prefs.cc', |
| 171 | 'proxy_resolver.cc', |
| 172 | 'real_system_state.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 173 | 'subprocess.cc', |
| 174 | 'terminator.cc', |
| 175 | 'update_attempter.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 176 | 'update_manager/boxed_value.cc', |
| 177 | 'update_manager/chromeos_policy.cc', |
Gilad Arnold | a23e408 | 2014-07-17 11:40:43 -0700 | [diff] [blame] | 178 | 'update_manager/default_policy.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 179 | 'update_manager/evaluation_context.cc', |
| 180 | 'update_manager/event_loop.cc', |
| 181 | 'update_manager/policy.cc', |
| 182 | 'update_manager/real_config_provider.cc', |
| 183 | 'update_manager/real_device_policy_provider.cc', |
| 184 | 'update_manager/real_random_provider.cc', |
| 185 | 'update_manager/real_shill_provider.cc', |
| 186 | 'update_manager/real_system_provider.cc', |
| 187 | 'update_manager/real_time_provider.cc', |
| 188 | 'update_manager/real_updater_provider.cc', |
| 189 | 'update_manager/state_factory.cc', |
| 190 | 'update_manager/update_manager.cc', |
| 191 | 'utils.cc', |
| 192 | ], |
| 193 | }, |
| 194 | # update_engine daemon. |
| 195 | { |
| 196 | 'target_name': 'update_engine', |
| 197 | 'type': 'executable', |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame] | 198 | 'dependencies': [ |
| 199 | 'libupdate_engine', |
| 200 | 'update_engine-dbus-server', |
| 201 | ], |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 202 | 'sources': [ |
| 203 | 'main.cc', |
| 204 | ] |
| 205 | }, |
| 206 | # update_engine console client. |
| 207 | { |
| 208 | 'target_name': 'update_engine_client', |
| 209 | 'type': 'executable', |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame] | 210 | 'dependencies': [ |
| 211 | 'update_engine-dbus-client', |
| 212 | ], |
| 213 | 'variables': { |
| 214 | 'exported_deps': [ |
| 215 | 'dbus-1', |
| 216 | 'dbus-glib-1', |
| 217 | 'glib-2.0', |
| 218 | 'gthread-2.0', |
| 219 | 'libchrome-<(libbase_ver)', |
| 220 | 'libchromeos-<(libbase_ver)', |
| 221 | ], |
| 222 | 'deps': ['<@(exported_deps)'], |
| 223 | }, |
| 224 | 'link_settings': { |
| 225 | 'variables': { |
| 226 | 'deps': [ |
| 227 | '<@(exported_deps)', |
| 228 | ], |
| 229 | }, |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame] | 230 | }, |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 231 | 'sources': [ |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame] | 232 | 'glib_utils.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 233 | 'update_engine_client.cc', |
| 234 | ] |
| 235 | }, |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 236 | # server-side code. This is used for delta_generator and unittests but not |
| 237 | # for any client code. |
| 238 | { |
| 239 | 'target_name': 'libpayload_generator', |
| 240 | 'type': 'static_library', |
| 241 | 'dependencies': [ |
| 242 | 'update_metadata-protos', |
| 243 | ], |
Alex Deymo | 5d52780 | 2014-07-18 14:24:13 -0700 | [diff] [blame] | 244 | 'variables': { |
| 245 | 'exported_deps': [ |
| 246 | 'ext2fs', |
| 247 | ], |
| 248 | 'deps': ['<@(exported_deps)'], |
| 249 | }, |
| 250 | 'all_dependent_settings': { |
| 251 | 'variables': { |
| 252 | 'deps': [ |
| 253 | '<@(exported_deps)', |
| 254 | ], |
| 255 | }, |
| 256 | }, |
| 257 | 'link_settings': { |
| 258 | 'variables': { |
| 259 | 'deps': [ |
| 260 | '<@(exported_deps)', |
| 261 | ], |
| 262 | }, |
| 263 | }, |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 264 | 'sources': [ |
| 265 | 'payload_generator/cycle_breaker.cc', |
| 266 | 'payload_generator/delta_diff_generator.cc', |
| 267 | 'payload_generator/extent_mapper.cc', |
| 268 | 'payload_generator/filesystem_iterator.cc', |
| 269 | 'payload_generator/full_update_generator.cc', |
| 270 | 'payload_generator/graph_utils.cc', |
| 271 | 'payload_generator/metadata.cc', |
| 272 | 'payload_generator/payload_signer.cc', |
| 273 | 'payload_generator/tarjan.cc', |
| 274 | 'payload_generator/topological_sort.cc', |
| 275 | ], |
| 276 | }, |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 277 | # server-side delta generator. |
| 278 | { |
| 279 | 'target_name': 'delta_generator', |
| 280 | 'type': 'executable', |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 281 | 'dependencies': [ |
| 282 | 'libupdate_engine', |
| 283 | 'libpayload_generator', |
| 284 | ], |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 285 | 'link_settings': { |
| 286 | 'ldflags!': [ |
| 287 | '-pie', |
| 288 | ], |
| 289 | }, |
| 290 | 'sources': [ |
| 291 | 'payload_generator/generate_delta_main.cc', |
| 292 | ] |
| 293 | }, |
| 294 | ], |
| 295 | 'conditions': [ |
| 296 | ['USE_test == 1', { |
| 297 | 'targets': [ |
| 298 | # Public keys used for unit testing. |
| 299 | { |
| 300 | 'target_name': 'update_engine-testkeys', |
| 301 | 'type': 'none', |
| 302 | 'variables': { |
| 303 | 'openssl_pem_in_dir': '.', |
| 304 | 'openssl_pem_out_dir': 'include/update_engine', |
| 305 | }, |
| 306 | 'sources': [ |
| 307 | 'unittest_key.pem', |
| 308 | 'unittest_key2.pem', |
| 309 | ], |
| 310 | 'includes': ['../common-mk/openssl_pem.gypi'], |
| 311 | }, |
| 312 | # Test HTTP Server. |
| 313 | { |
| 314 | 'target_name': 'test_http_server', |
| 315 | 'type': 'executable', |
| 316 | 'dependencies': ['libupdate_engine'], |
| 317 | 'sources': [ |
| 318 | 'test_http_server.cc', |
| 319 | ] |
| 320 | }, |
| 321 | # Main unittest file. |
| 322 | { |
| 323 | 'target_name': 'update_engine_unittests', |
| 324 | 'type': 'executable', |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 325 | 'dependencies': [ |
| 326 | 'libupdate_engine', |
| 327 | 'libpayload_generator', |
| 328 | ], |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 329 | 'includes': ['../common-mk/common_test.gypi'], |
| 330 | 'defines': [ |
| 331 | 'SYSROOT="<(sysroot)"', |
| 332 | ], |
| 333 | 'sources': [ |
| 334 | 'action_pipe_unittest.cc', |
| 335 | 'action_processor_unittest.cc', |
| 336 | 'action_unittest.cc', |
| 337 | 'bzip_extent_writer_unittest.cc', |
| 338 | 'certificate_checker_unittest.cc', |
| 339 | 'chrome_browser_proxy_resolver_unittest.cc', |
| 340 | 'connection_manager_unittest.cc', |
| 341 | 'delta_performer_unittest.cc', |
| 342 | 'download_action_unittest.cc', |
| 343 | 'extent_ranges_unittest.cc', |
| 344 | 'extent_writer_unittest.cc', |
| 345 | 'fake_prefs.cc', |
| 346 | 'fake_system_state.cc', |
| 347 | 'file_writer_unittest.cc', |
| 348 | 'filesystem_copier_action_unittest.cc', |
| 349 | 'http_fetcher_unittest.cc', |
| 350 | 'hwid_override_unittest.cc', |
| 351 | 'mock_http_fetcher.cc', |
| 352 | 'omaha_hash_calculator_unittest.cc', |
| 353 | 'omaha_request_action_unittest.cc', |
| 354 | 'omaha_request_params_unittest.cc', |
| 355 | 'omaha_response_handler_action_unittest.cc', |
| 356 | 'p2p_manager_unittest.cc', |
| 357 | 'payload_generator/cycle_breaker_unittest.cc', |
| 358 | 'payload_generator/delta_diff_generator_unittest.cc', |
| 359 | 'payload_generator/extent_mapper_unittest.cc', |
| 360 | 'payload_generator/filesystem_iterator_unittest.cc', |
| 361 | 'payload_generator/full_update_generator_unittest.cc', |
| 362 | 'payload_generator/graph_utils_unittest.cc', |
| 363 | 'payload_generator/metadata_unittest.cc', |
Alex Deymo | 923d8fa | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 364 | 'payload_generator/payload_signer_unittest.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 365 | 'payload_generator/tarjan_unittest.cc', |
| 366 | 'payload_generator/topological_sort_unittest.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 367 | 'payload_state_unittest.cc', |
| 368 | 'postinstall_runner_action_unittest.cc', |
| 369 | 'prefs_unittest.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 370 | 'subprocess_unittest.cc', |
| 371 | 'terminator_unittest.cc', |
| 372 | 'test_utils.cc', |
Alex Deymo | 10875d9 | 2014-11-10 21:52:57 -0800 | [diff] [blame] | 373 | 'test_utils_unittest.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 374 | 'update_attempter_unittest.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 375 | 'update_manager/boxed_value_unittest.cc', |
| 376 | 'update_manager/chromeos_policy_unittest.cc', |
| 377 | 'update_manager/evaluation_context_unittest.cc', |
| 378 | 'update_manager/event_loop_unittest.cc', |
| 379 | 'update_manager/generic_variables_unittest.cc', |
| 380 | 'update_manager/prng_unittest.cc', |
| 381 | 'update_manager/real_config_provider_unittest.cc', |
| 382 | 'update_manager/real_device_policy_provider_unittest.cc', |
| 383 | 'update_manager/real_random_provider_unittest.cc', |
| 384 | 'update_manager/real_shill_provider_unittest.cc', |
| 385 | 'update_manager/real_system_provider_unittest.cc', |
| 386 | 'update_manager/real_time_provider_unittest.cc', |
| 387 | 'update_manager/real_updater_provider_unittest.cc', |
| 388 | 'update_manager/umtest_utils.cc', |
| 389 | 'update_manager/update_manager_unittest.cc', |
| 390 | 'update_manager/variable_unittest.cc', |
| 391 | 'utils_unittest.cc', |
| 392 | 'zip_unittest.cc', |
| 393 | # Main entry point for runnning tests. |
| 394 | 'testrunner.cc', |
| 395 | ], |
| 396 | }, |
| 397 | ], |
| 398 | }], |
| 399 | ], |
| 400 | } |