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', |
| 24 | '-std=gnu++11', |
| 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': [ |
| 46 | 'protobuf', |
| 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', |
| 110 | 'libxml-2.0', |
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', |
| 129 | '-lgflags', |
| 130 | '-lpolicy-<(libbase_ver)', |
| 131 | '-lrootdev', |
| 132 | '-lrt', |
| 133 | '-lvboot_host', |
| 134 | ], |
| 135 | }, |
| 136 | 'sources': [ |
| 137 | 'action_processor.cc', |
| 138 | 'bzip.cc', |
| 139 | 'bzip_extent_writer.cc', |
| 140 | 'certificate_checker.cc', |
| 141 | 'chrome_browser_proxy_resolver.cc', |
| 142 | 'clock.cc', |
| 143 | 'connection_manager.cc', |
| 144 | 'constants.cc', |
| 145 | 'dbus_service.cc', |
| 146 | 'delta_performer.cc', |
| 147 | 'download_action.cc', |
| 148 | 'extent_ranges.cc', |
| 149 | 'extent_writer.cc', |
| 150 | 'file_descriptor.cc', |
| 151 | 'file_writer.cc', |
| 152 | 'filesystem_copier_action.cc', |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame^] | 153 | 'glib_utils.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 154 | 'hardware.cc', |
| 155 | 'http_common.cc', |
| 156 | 'http_fetcher.cc', |
| 157 | 'hwid_override.cc', |
| 158 | 'install_plan.cc', |
| 159 | 'libcurl_http_fetcher.cc', |
| 160 | 'metrics.cc', |
| 161 | 'multi_range_http_fetcher.cc', |
| 162 | 'omaha_hash_calculator.cc', |
| 163 | 'omaha_request_action.cc', |
| 164 | 'omaha_request_params.cc', |
| 165 | 'omaha_response_handler_action.cc', |
| 166 | 'p2p_manager.cc', |
| 167 | 'payload_constants.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 168 | 'payload_state.cc', |
Alex Deymo | 923d8fa | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 169 | 'payload_verifier.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 170 | 'postinstall_runner_action.cc', |
| 171 | 'prefs.cc', |
| 172 | 'proxy_resolver.cc', |
| 173 | 'real_system_state.cc', |
| 174 | 'simple_key_value_store.cc', |
| 175 | 'subprocess.cc', |
| 176 | 'terminator.cc', |
| 177 | 'update_attempter.cc', |
| 178 | 'update_check_scheduler.cc', |
| 179 | 'update_manager/boxed_value.cc', |
| 180 | 'update_manager/chromeos_policy.cc', |
Gilad Arnold | a23e408 | 2014-07-17 11:40:43 -0700 | [diff] [blame] | 181 | 'update_manager/default_policy.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 182 | 'update_manager/evaluation_context.cc', |
| 183 | 'update_manager/event_loop.cc', |
| 184 | 'update_manager/policy.cc', |
| 185 | 'update_manager/real_config_provider.cc', |
| 186 | 'update_manager/real_device_policy_provider.cc', |
| 187 | 'update_manager/real_random_provider.cc', |
| 188 | 'update_manager/real_shill_provider.cc', |
| 189 | 'update_manager/real_system_provider.cc', |
| 190 | 'update_manager/real_time_provider.cc', |
| 191 | 'update_manager/real_updater_provider.cc', |
| 192 | 'update_manager/state_factory.cc', |
| 193 | 'update_manager/update_manager.cc', |
| 194 | 'utils.cc', |
| 195 | ], |
| 196 | }, |
| 197 | # update_engine daemon. |
| 198 | { |
| 199 | 'target_name': 'update_engine', |
| 200 | 'type': 'executable', |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame^] | 201 | 'dependencies': [ |
| 202 | 'libupdate_engine', |
| 203 | 'update_engine-dbus-server', |
| 204 | ], |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 205 | 'sources': [ |
| 206 | 'main.cc', |
| 207 | ] |
| 208 | }, |
| 209 | # update_engine console client. |
| 210 | { |
| 211 | 'target_name': 'update_engine_client', |
| 212 | 'type': 'executable', |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame^] | 213 | 'dependencies': [ |
| 214 | 'update_engine-dbus-client', |
| 215 | ], |
| 216 | 'variables': { |
| 217 | 'exported_deps': [ |
| 218 | 'dbus-1', |
| 219 | 'dbus-glib-1', |
| 220 | 'glib-2.0', |
| 221 | 'gthread-2.0', |
| 222 | 'libchrome-<(libbase_ver)', |
| 223 | 'libchromeos-<(libbase_ver)', |
| 224 | ], |
| 225 | 'deps': ['<@(exported_deps)'], |
| 226 | }, |
| 227 | 'link_settings': { |
| 228 | 'variables': { |
| 229 | 'deps': [ |
| 230 | '<@(exported_deps)', |
| 231 | ], |
| 232 | }, |
| 233 | 'libraries': [ |
| 234 | '-lgflags', |
| 235 | ], |
| 236 | }, |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 237 | 'sources': [ |
Alex Deymo | 44666f9 | 2014-07-22 20:29:24 -0700 | [diff] [blame^] | 238 | 'glib_utils.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 239 | 'update_engine_client.cc', |
| 240 | ] |
| 241 | }, |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 242 | # server-side code. This is used for delta_generator and unittests but not |
| 243 | # for any client code. |
| 244 | { |
| 245 | 'target_name': 'libpayload_generator', |
| 246 | 'type': 'static_library', |
| 247 | 'dependencies': [ |
| 248 | 'update_metadata-protos', |
| 249 | ], |
Alex Deymo | 5d52780 | 2014-07-18 14:24:13 -0700 | [diff] [blame] | 250 | 'variables': { |
| 251 | 'exported_deps': [ |
| 252 | 'ext2fs', |
| 253 | ], |
| 254 | 'deps': ['<@(exported_deps)'], |
| 255 | }, |
| 256 | 'all_dependent_settings': { |
| 257 | 'variables': { |
| 258 | 'deps': [ |
| 259 | '<@(exported_deps)', |
| 260 | ], |
| 261 | }, |
| 262 | }, |
| 263 | 'link_settings': { |
| 264 | 'variables': { |
| 265 | 'deps': [ |
| 266 | '<@(exported_deps)', |
| 267 | ], |
| 268 | }, |
| 269 | }, |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 270 | 'sources': [ |
| 271 | 'payload_generator/cycle_breaker.cc', |
| 272 | 'payload_generator/delta_diff_generator.cc', |
| 273 | 'payload_generator/extent_mapper.cc', |
| 274 | 'payload_generator/filesystem_iterator.cc', |
| 275 | 'payload_generator/full_update_generator.cc', |
| 276 | 'payload_generator/graph_utils.cc', |
| 277 | 'payload_generator/metadata.cc', |
| 278 | 'payload_generator/payload_signer.cc', |
| 279 | 'payload_generator/tarjan.cc', |
| 280 | 'payload_generator/topological_sort.cc', |
| 281 | ], |
| 282 | }, |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 283 | # server-side delta generator. |
| 284 | { |
| 285 | 'target_name': 'delta_generator', |
| 286 | 'type': 'executable', |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 287 | 'dependencies': [ |
| 288 | 'libupdate_engine', |
| 289 | 'libpayload_generator', |
| 290 | ], |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 291 | 'link_settings': { |
| 292 | 'ldflags!': [ |
| 293 | '-pie', |
| 294 | ], |
| 295 | }, |
| 296 | 'sources': [ |
| 297 | 'payload_generator/generate_delta_main.cc', |
| 298 | ] |
| 299 | }, |
| 300 | ], |
| 301 | 'conditions': [ |
| 302 | ['USE_test == 1', { |
| 303 | 'targets': [ |
| 304 | # Public keys used for unit testing. |
| 305 | { |
| 306 | 'target_name': 'update_engine-testkeys', |
| 307 | 'type': 'none', |
| 308 | 'variables': { |
| 309 | 'openssl_pem_in_dir': '.', |
| 310 | 'openssl_pem_out_dir': 'include/update_engine', |
| 311 | }, |
| 312 | 'sources': [ |
| 313 | 'unittest_key.pem', |
| 314 | 'unittest_key2.pem', |
| 315 | ], |
| 316 | 'includes': ['../common-mk/openssl_pem.gypi'], |
| 317 | }, |
| 318 | # Test HTTP Server. |
| 319 | { |
| 320 | 'target_name': 'test_http_server', |
| 321 | 'type': 'executable', |
| 322 | 'dependencies': ['libupdate_engine'], |
| 323 | 'sources': [ |
| 324 | 'test_http_server.cc', |
| 325 | ] |
| 326 | }, |
| 327 | # Main unittest file. |
| 328 | { |
| 329 | 'target_name': 'update_engine_unittests', |
| 330 | 'type': 'executable', |
Alex Deymo | 7504e5f | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 331 | 'dependencies': [ |
| 332 | 'libupdate_engine', |
| 333 | 'libpayload_generator', |
| 334 | ], |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 335 | 'includes': ['../common-mk/common_test.gypi'], |
| 336 | 'defines': [ |
| 337 | 'SYSROOT="<(sysroot)"', |
| 338 | ], |
| 339 | 'sources': [ |
| 340 | 'action_pipe_unittest.cc', |
| 341 | 'action_processor_unittest.cc', |
| 342 | 'action_unittest.cc', |
| 343 | 'bzip_extent_writer_unittest.cc', |
| 344 | 'certificate_checker_unittest.cc', |
| 345 | 'chrome_browser_proxy_resolver_unittest.cc', |
| 346 | 'connection_manager_unittest.cc', |
| 347 | 'delta_performer_unittest.cc', |
| 348 | 'download_action_unittest.cc', |
| 349 | 'extent_ranges_unittest.cc', |
| 350 | 'extent_writer_unittest.cc', |
| 351 | 'fake_prefs.cc', |
| 352 | 'fake_system_state.cc', |
| 353 | 'file_writer_unittest.cc', |
| 354 | 'filesystem_copier_action_unittest.cc', |
| 355 | 'http_fetcher_unittest.cc', |
| 356 | 'hwid_override_unittest.cc', |
| 357 | 'mock_http_fetcher.cc', |
| 358 | 'omaha_hash_calculator_unittest.cc', |
| 359 | 'omaha_request_action_unittest.cc', |
| 360 | 'omaha_request_params_unittest.cc', |
| 361 | 'omaha_response_handler_action_unittest.cc', |
| 362 | 'p2p_manager_unittest.cc', |
| 363 | 'payload_generator/cycle_breaker_unittest.cc', |
| 364 | 'payload_generator/delta_diff_generator_unittest.cc', |
| 365 | 'payload_generator/extent_mapper_unittest.cc', |
| 366 | 'payload_generator/filesystem_iterator_unittest.cc', |
| 367 | 'payload_generator/full_update_generator_unittest.cc', |
| 368 | 'payload_generator/graph_utils_unittest.cc', |
| 369 | 'payload_generator/metadata_unittest.cc', |
Alex Deymo | 923d8fa | 2014-07-15 17:58:51 -0700 | [diff] [blame] | 370 | 'payload_generator/payload_signer_unittest.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 371 | 'payload_generator/tarjan_unittest.cc', |
| 372 | 'payload_generator/topological_sort_unittest.cc', |
Alex Deymo | 719bfff | 2014-07-11 12:12:32 -0700 | [diff] [blame] | 373 | 'payload_state_unittest.cc', |
| 374 | 'postinstall_runner_action_unittest.cc', |
| 375 | 'prefs_unittest.cc', |
| 376 | 'simple_key_value_store_unittest.cc', |
| 377 | 'subprocess_unittest.cc', |
| 378 | 'terminator_unittest.cc', |
| 379 | 'test_utils.cc', |
| 380 | 'update_attempter_unittest.cc', |
| 381 | 'update_check_scheduler_unittest.cc', |
| 382 | 'update_manager/boxed_value_unittest.cc', |
| 383 | 'update_manager/chromeos_policy_unittest.cc', |
| 384 | 'update_manager/evaluation_context_unittest.cc', |
| 385 | 'update_manager/event_loop_unittest.cc', |
| 386 | 'update_manager/generic_variables_unittest.cc', |
| 387 | 'update_manager/prng_unittest.cc', |
| 388 | 'update_manager/real_config_provider_unittest.cc', |
| 389 | 'update_manager/real_device_policy_provider_unittest.cc', |
| 390 | 'update_manager/real_random_provider_unittest.cc', |
| 391 | 'update_manager/real_shill_provider_unittest.cc', |
| 392 | 'update_manager/real_system_provider_unittest.cc', |
| 393 | 'update_manager/real_time_provider_unittest.cc', |
| 394 | 'update_manager/real_updater_provider_unittest.cc', |
| 395 | 'update_manager/umtest_utils.cc', |
| 396 | 'update_manager/update_manager_unittest.cc', |
| 397 | 'update_manager/variable_unittest.cc', |
| 398 | 'utils_unittest.cc', |
| 399 | 'zip_unittest.cc', |
| 400 | # Main entry point for runnning tests. |
| 401 | 'testrunner.cc', |
| 402 | ], |
| 403 | }, |
| 404 | ], |
| 405 | }], |
| 406 | ], |
| 407 | } |