1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 { 6 'variables': { 7 'chromium_code': 1, 8 }, 9 'includes': [ 10 '../build/win_precompile.gypi', 11 'base.gypi', 12 ], 13 'targets': [ 14 { 15 'target_name': 'base', 16 'type': '<(component)', 17 'toolsets': ['host', 'target'], 18 'variables': { 19 'base_target': 1, 20 'enable_wexit_time_destructors': 1, 21 'optimize': 'max', 22 }, 23 'dependencies': [ 24 'base_static', 25 'allocator/allocator.gyp:allocator_extension_thunks', 26 '../testing/gtest.gyp:gtest_prod', 27 '../third_party/modp_b64/modp_b64.gyp:modp_b64', 28 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', 29 ], 30 # TODO(gregoryd): direct_dependent_settings should be shared with the 31 # 64-bit target, but it doesn't work due to a bug in gyp 32 'direct_dependent_settings': { 33 'include_dirs': [ 34 '..', 35 ], 36 }, 37 'conditions': [ 38 ['use_glib==1', { 39 'conditions': [ 40 ['chromeos==1', { 41 'sources/': [ ['include', '_chromeos\\.cc$'] ] 42 }], 43 ['toolkit_uses_gtk==1', { 44 'dependencies': [ 45 '../build/linux/system.gyp:gtk', 46 ], 47 'export_dependent_settings': [ 48 '../build/linux/system.gyp:gtk', 49 ], 50 }], 51 ], 52 'dependencies': [ 53 'symbolize', 54 '../build/linux/system.gyp:glib', 55 'xdg_mime', 56 ], 57 'defines': [ 58 'USE_SYMBOLIZE', 59 ], 60 'cflags': [ 61 '-Wno-write-strings', 62 ], 63 'export_dependent_settings': [ 64 '../build/linux/system.gyp:glib', 65 ], 66 }, { # use_glib!=1 67 'sources/': [ 68 ['exclude', '/xdg_user_dirs/'], 69 ['exclude', '_nss\\.cc$'], 70 ], 71 }], 72 ['use_x11==1', { 73 'dependencies': [ 74 '../build/linux/system.gyp:x11', 75 ], 76 'export_dependent_settings': [ 77 '../build/linux/system.gyp:x11', 78 ], 79 }], 80 ['OS == "android" and _toolset == "host"', { 81 # Always build base as a static_library for host toolset, even if 82 # we're doing a component build. Specifically, we only care about the 83 # target toolset using components since that's what developers are 84 # focusing on. In theory we should do this more generally for all 85 # targets when building for host, but getting the gyp magic 86 # per-toolset for the "component" variable is hard, and we really only 87 # need base on host. 88 'type': 'static_library', 89 # Base for host support is the minimum required to run the 90 # ssl false start blacklist tool. It requires further changes 91 # to generically support host builds (and tests). 92 # Note: when building for host, gyp has OS == "android", 93 # hence the *_android.cc files are included but the actual code 94 # doesn't have OS_ANDROID / ANDROID defined. 95 'conditions': [ 96 # Host build on linux depends on system.gyp::gtk as 97 # default linux build has TOOLKIT_GTK defined. 98 ['host_os == "linux"', { 99 'sources/': [ 100 ['include', '^atomicops_internals_x86_gcc\\.cc$'], 101 ], 102 'dependencies': [ 103 '../build/linux/system.gyp:gtk', 104 ], 105 'export_dependent_settings': [ 106 '../build/linux/system.gyp:gtk', 107 ], 108 }], 109 ['host_os == "mac"', { 110 'sources/': [ 111 ['exclude', '^native_library_linux\\.cc$'], 112 ['exclude', '^process_util_linux\\.cc$'], 113 ['exclude', '^sys_info_linux\\.cc$'], 114 ['exclude', '^sys_string_conversions_linux\\.cc$'], 115 ['exclude', '^worker_pool_linux\\.cc$'], 116 ], 117 }], 118 ], 119 }], 120 ['OS == "android" and _toolset == "target"', { 121 'conditions': [ 122 ['target_arch == "ia32"', { 123 'sources/': [ 124 ['include', '^atomicops_internals_x86_gcc\\.cc$'], 125 ], 126 }], 127 ['target_arch == "mipsel"', { 128 'sources/': [ 129 ['include', '^atomicops_internals_mips_gcc\\.cc$'], 130 ], 131 }], 132 ], 133 'dependencies': [ 134 'base_jni_headers', 135 '../third_party/ashmem/ashmem.gyp:ashmem', 136 ], 137 'include_dirs': [ 138 '<(SHARED_INTERMEDIATE_DIR)/base', 139 ], 140 'link_settings': { 141 'libraries': [ 142 '-llog', 143 ], 144 }, 145 'sources!': [ 146 'debug/stack_trace_posix.cc', 147 ], 148 'includes': [ 149 '../build/android/cpufeatures.gypi', 150 ], 151 }], 152 ['OS == "android" and _toolset == "target" and android_webview_build == 0', { 153 'dependencies': [ 154 'base_java', 155 ], 156 }], 157 ['os_bsd==1', { 158 'include_dirs': [ 159 '/usr/local/include', 160 ], 161 'link_settings': { 162 'libraries': [ 163 '-L/usr/local/lib -lexecinfo', 164 ], 165 }, 166 }], 167 ['OS == "linux"', { 168 'link_settings': { 169 'libraries': [ 170 # We need rt for clock_gettime(). 171 '-lrt', 172 # For 'native_library_linux.cc' 173 '-ldl', 174 ], 175 }, 176 'conditions': [ 177 ['linux_use_tcmalloc==0', { 178 'defines': [ 179 'NO_TCMALLOC', 180 ], 181 'direct_dependent_settings': { 182 'defines': [ 183 'NO_TCMALLOC', 184 ], 185 }, 186 }], 187 ], 188 }], 189 ['OS == "mac" or (OS == "ios" and _toolset == "host")', { 190 'link_settings': { 191 'libraries': [ 192 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', 193 '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', 194 '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', 195 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', 196 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', 197 '$(SDKROOT)/System/Library/Frameworks/IOKit.framework', 198 '$(SDKROOT)/System/Library/Frameworks/Security.framework', 199 ], 200 }, 201 'dependencies': [ 202 '../third_party/mach_override/mach_override.gyp:mach_override', 203 ], 204 }], 205 ['OS == "ios" and _toolset != "host"', { 206 'link_settings': { 207 'libraries': [ 208 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', 209 '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework', 210 '$(SDKROOT)/System/Library/Frameworks/CoreText.framework', 211 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', 212 '$(SDKROOT)/System/Library/Frameworks/UIKit.framework', 213 ], 214 }, 215 }], 216 ['OS != "win" and OS != "ios"', { 217 'dependencies': ['../third_party/libevent/libevent.gyp:libevent'], 218 },], 219 ['component=="shared_library"', { 220 'conditions': [ 221 ['OS=="win"', { 222 'sources!': [ 223 'debug/debug_on_start_win.cc', 224 ], 225 }], 226 ], 227 }], 228 ['use_system_nspr==1', { 229 'dependencies': [ 230 'third_party/nspr/nspr.gyp:nspr', 231 ], 232 }], 233 ], 234 'sources': [ 235 'third_party/nspr/prcpucfg.h', 236 'third_party/nspr/prcpucfg_win.h', 237 'third_party/nspr/prtypes.h', 238 'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', 239 'third_party/xdg_user_dirs/xdg_user_dir_lookup.h', 240 'auto_reset.h', 241 'event_recorder.h', 242 'event_recorder_stubs.cc', 243 'event_recorder_win.cc', 244 'linux_util.cc', 245 'linux_util.h', 246 'md5.cc', 247 'md5.h', 248 'message_loop/message_pump_android.cc', 249 'message_loop/message_pump_android.h', 250 'message_loop/message_pump_glib.cc', 251 'message_loop/message_pump_glib.h', 252 'message_loop/message_pump_gtk.cc', 253 'message_loop/message_pump_gtk.h', 254 'message_loop/message_pump_io_ios.cc', 255 'message_loop/message_pump_io_ios.h', 256 'message_loop/message_pump_observer.h', 257 'message_loop/message_pump_aurax11.cc', 258 'message_loop/message_pump_aurax11.h', 259 'message_loop/message_pump_libevent.cc', 260 'message_loop/message_pump_libevent.h', 261 'message_loop/message_pump_mac.h', 262 'message_loop/message_pump_mac.mm', 263 'metrics/field_trial.cc', 264 'metrics/field_trial.h', 265 'posix/file_descriptor_shuffle.cc', 266 'posix/file_descriptor_shuffle.h', 267 'sync_socket.h', 268 'sync_socket_win.cc', 269 'sync_socket_posix.cc', 270 ], 271 }, 272 { 273 'target_name': 'base_i18n', 274 'type': '<(component)', 275 'variables': { 276 'enable_wexit_time_destructors': 1, 277 'optimize': 'max', 278 }, 279 'dependencies': [ 280 'base', 281 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', 282 '../third_party/icu/icu.gyp:icui18n', 283 '../third_party/icu/icu.gyp:icuuc', 284 ], 285 'conditions': [ 286 ['toolkit_uses_gtk==1', { 287 'dependencies': [ 288 # i18n/rtl.cc uses gtk 289 '../build/linux/system.gyp:gtk', 290 ], 291 }], 292 ['OS == "win"', { 293 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 294 'msvs_disabled_warnings': [ 295 4267, 296 ], 297 }], 298 ], 299 'export_dependent_settings': [ 300 'base', 301 ], 302 'defines': [ 303 'BASE_I18N_IMPLEMENTATION', 304 ], 305 'sources': [ 306 'i18n/base_i18n_export.h', 307 'i18n/bidi_line_iterator.cc', 308 'i18n/bidi_line_iterator.h', 309 'i18n/break_iterator.cc', 310 'i18n/break_iterator.h', 311 'i18n/char_iterator.cc', 312 'i18n/char_iterator.h', 313 'i18n/case_conversion.cc', 314 'i18n/case_conversion.h', 315 'i18n/file_util_icu.cc', 316 'i18n/file_util_icu.h', 317 'i18n/i18n_constants.cc', 318 'i18n/i18n_constants.h', 319 'i18n/icu_encoding_detection.cc', 320 'i18n/icu_encoding_detection.h', 321 'i18n/icu_string_conversions.cc', 322 'i18n/icu_string_conversions.h', 323 'i18n/icu_util.cc', 324 'i18n/icu_util.h', 325 'i18n/number_formatting.cc', 326 'i18n/number_formatting.h', 327 'i18n/rtl.cc', 328 'i18n/rtl.h', 329 'i18n/string_compare.cc', 330 'i18n/string_compare.h', 331 'i18n/string_search.cc', 332 'i18n/string_search.h', 333 'i18n/time_formatting.cc', 334 'i18n/time_formatting.h', 335 ], 336 }, 337 { 338 'target_name': 'base_prefs', 339 'type': '<(component)', 340 'variables': { 341 'enable_wexit_time_destructors': 1, 342 'optimize': 'max', 343 }, 344 'dependencies': [ 345 'base', 346 ], 347 'export_dependent_settings': [ 348 'base', 349 ], 350 'defines': [ 351 'BASE_PREFS_IMPLEMENTATION', 352 ], 353 'sources': [ 354 'prefs/base_prefs_export.h', 355 'prefs/default_pref_store.cc', 356 'prefs/default_pref_store.h', 357 'prefs/json_pref_store.cc', 358 'prefs/json_pref_store.h', 359 'prefs/overlay_user_pref_store.cc', 360 'prefs/overlay_user_pref_store.h', 361 'prefs/persistent_pref_store.h', 362 'prefs/pref_change_registrar.cc', 363 'prefs/pref_change_registrar.h', 364 'prefs/pref_member.cc', 365 'prefs/pref_member.h', 366 'prefs/pref_notifier.h', 367 'prefs/pref_notifier_impl.cc', 368 'prefs/pref_notifier_impl.h', 369 'prefs/pref_observer.h', 370 'prefs/pref_registry.cc', 371 'prefs/pref_registry.h', 372 'prefs/pref_registry_simple.cc', 373 'prefs/pref_registry_simple.h', 374 'prefs/pref_service.cc', 375 'prefs/pref_service.h', 376 'prefs/pref_service_builder.cc', 377 'prefs/pref_service_builder.h', 378 'prefs/pref_store.cc', 379 'prefs/pref_store.h', 380 'prefs/pref_value_map.cc', 381 'prefs/pref_value_map.h', 382 'prefs/pref_value_store.cc', 383 'prefs/pref_value_store.h', 384 'prefs/value_map_pref_store.cc', 385 'prefs/value_map_pref_store.h', 386 ], 387 }, 388 { 389 'target_name': 'base_prefs_test_support', 390 'type': 'static_library', 391 'dependencies': [ 392 'base', 393 'base_prefs', 394 '../testing/gmock.gyp:gmock', 395 ], 396 'sources': [ 397 'prefs/mock_pref_change_callback.cc', 398 'prefs/pref_store_observer_mock.cc', 399 'prefs/pref_store_observer_mock.h', 400 'prefs/testing_pref_service.cc', 401 'prefs/testing_pref_service.h', 402 'prefs/testing_pref_store.cc', 403 'prefs/testing_pref_store.h', 404 ], 405 }, 406 { 407 # This is the subset of files from base that should not be used with a 408 # dynamic library. Note that this library cannot depend on base because 409 # base depends on base_static. 410 'target_name': 'base_static', 411 'type': 'static_library', 412 'variables': { 413 'enable_wexit_time_destructors': 1, 414 'optimize': 'max', 415 }, 416 'toolsets': ['host', 'target'], 417 'sources': [ 418 'base_switches.cc', 419 'base_switches.h', 420 'win/pe_image.cc', 421 'win/pe_image.h', 422 ], 423 'include_dirs': [ 424 '..', 425 ], 426 }, 427 # Include this target for a main() function that simply instantiates 428 # and runs a base::TestSuite. 429 { 430 'target_name': 'run_all_unittests', 431 'type': 'static_library', 432 'dependencies': [ 433 'test_support_base', 434 ], 435 'sources': [ 436 'test/run_all_unittests.cc', 437 ], 438 }, 439 { 440 'target_name': 'base_unittests', 441 'type': '<(gtest_target_type)', 442 'sources': [ 443 # Tests. 444 'android/activity_status_unittest.cc', 445 'android/jni_android_unittest.cc', 446 'android/jni_array_unittest.cc', 447 'android/jni_string_unittest.cc', 448 'android/path_utils_unittest.cc', 449 'android/scoped_java_ref_unittest.cc', 450 'at_exit_unittest.cc', 451 'atomicops_unittest.cc', 452 'base64_unittest.cc', 453 'bind_helpers_unittest.cc', 454 'bind_unittest.cc', 455 'bind_unittest.nc', 456 'bits_unittest.cc', 457 'build_time_unittest.cc', 458 'callback_unittest.cc', 459 'callback_unittest.nc', 460 'cancelable_callback_unittest.cc', 461 'command_line_unittest.cc', 462 'containers/hash_tables_unittest.cc', 463 'containers/linked_list_unittest.cc', 464 'containers/mru_cache_unittest.cc', 465 'containers/small_map_unittest.cc', 466 'containers/stack_container_unittest.cc', 467 'cpu_unittest.cc', 468 'debug/crash_logging_unittest.cc', 469 'debug/leak_tracker_unittest.cc', 470 'debug/proc_maps_linux_unittest.cc', 471 'debug/stack_trace_unittest.cc', 472 'debug/trace_event_memory_unittest.cc', 473 'debug/trace_event_unittest.cc', 474 'debug/trace_event_unittest.h', 475 'debug/trace_event_win_unittest.cc', 476 'deferred_sequenced_task_runner_unittest.cc', 477 'environment_unittest.cc', 478 'file_util_unittest.cc', 479 'file_version_info_unittest.cc', 480 'files/dir_reader_posix_unittest.cc', 481 'files/file_path_unittest.cc', 482 'files/file_util_proxy_unittest.cc', 483 'files/important_file_writer_unittest.cc', 484 'files/scoped_temp_dir_unittest.cc', 485 'gmock_unittest.cc', 486 'guid_unittest.cc', 487 'id_map_unittest.cc', 488 'i18n/break_iterator_unittest.cc', 489 'i18n/char_iterator_unittest.cc', 490 'i18n/case_conversion_unittest.cc', 491 'i18n/file_util_icu_unittest.cc', 492 'i18n/icu_string_conversions_unittest.cc', 493 'i18n/number_formatting_unittest.cc', 494 'i18n/rtl_unittest.cc', 495 'i18n/string_search_unittest.cc', 496 'i18n/time_formatting_unittest.cc', 497 'ini_parser_unittest.cc', 498 'ios/device_util_unittest.mm', 499 'json/json_parser_unittest.cc', 500 'json/json_reader_unittest.cc', 501 'json/json_value_converter_unittest.cc', 502 'json/json_value_serializer_unittest.cc', 503 'json/json_writer_unittest.cc', 504 'json/string_escape_unittest.cc', 505 'lazy_instance_unittest.cc', 506 'logging_unittest.cc', 507 'mac/bind_objc_block_unittest.mm', 508 'mac/foundation_util_unittest.mm', 509 'mac/libdispatch_task_runner_unittest.cc', 510 'mac/mac_util_unittest.mm', 511 'mac/objc_property_releaser_unittest.mm', 512 'mac/scoped_nsobject_unittest.mm', 513 'mac/scoped_sending_event_unittest.mm', 514 'md5_unittest.cc', 515 'memory/aligned_memory_unittest.cc', 516 'memory/discardable_memory_unittest.cc', 517 'memory/linked_ptr_unittest.cc', 518 'memory/ref_counted_memory_unittest.cc', 519 'memory/ref_counted_unittest.cc', 520 'memory/scoped_ptr_unittest.cc', 521 'memory/scoped_ptr_unittest.nc', 522 'memory/scoped_vector_unittest.cc', 523 'memory/shared_memory_unittest.cc', 524 'memory/singleton_unittest.cc', 525 'memory/weak_ptr_unittest.cc', 526 'memory/weak_ptr_unittest.nc', 527 'message_loop/message_loop_proxy_impl_unittest.cc', 528 'message_loop/message_loop_proxy_unittest.cc', 529 'message_loop/message_loop_unittest.cc', 530 'message_loop/message_pump_glib_unittest.cc', 531 'message_loop/message_pump_io_ios_unittest.cc', 532 'message_loop/message_pump_libevent_unittest.cc', 533 'metrics/sample_map_unittest.cc', 534 'metrics/sample_vector_unittest.cc', 535 'metrics/bucket_ranges_unittest.cc', 536 'metrics/field_trial_unittest.cc', 537 'metrics/histogram_base_unittest.cc', 538 'metrics/histogram_unittest.cc', 539 'metrics/sparse_histogram_unittest.cc', 540 'metrics/stats_table_unittest.cc', 541 'metrics/statistics_recorder_unittest.cc', 542 'observer_list_unittest.cc', 543 'os_compat_android_unittest.cc', 544 'path_service_unittest.cc', 545 'pickle_unittest.cc', 546 'platform_file_unittest.cc', 547 'posix/file_descriptor_shuffle_unittest.cc', 548 'posix/unix_domain_socket_linux_unittest.cc', 549 'power_monitor/power_monitor_unittest.cc', 550 'prefs/default_pref_store_unittest.cc', 551 'prefs/json_pref_store_unittest.cc', 552 'prefs/mock_pref_change_callback.h', 553 'prefs/overlay_user_pref_store_unittest.cc', 554 'prefs/pref_change_registrar_unittest.cc', 555 'prefs/pref_member_unittest.cc', 556 'prefs/pref_notifier_impl_unittest.cc', 557 'prefs/pref_service_unittest.cc', 558 'prefs/pref_value_map_unittest.cc', 559 'prefs/pref_value_store_unittest.cc', 560 'process/memory_unittest.cc', 561 'process/memory_unittest_mac.h', 562 'process/memory_unittest_mac.mm', 563 'process/process_util_unittest.cc', 564 'process/process_util_unittest_ios.cc', 565 'profiler/tracked_time_unittest.cc', 566 'rand_util_unittest.cc', 567 'safe_numerics_unittest.cc', 568 'safe_numerics_unittest.nc', 569 'scoped_clear_errno_unittest.cc', 570 'scoped_native_library_unittest.cc', 571 'scoped_observer.h', 572 'security_unittest.cc', 573 'sequence_checker_unittest.cc', 574 'sha1_unittest.cc', 575 'stl_util_unittest.cc', 576 'strings/nullable_string16_unittest.cc', 577 'strings/string16_unittest.cc', 578 'strings/stringprintf_unittest.cc', 579 'strings/string_number_conversions_unittest.cc', 580 'strings/string_piece_unittest.cc', 581 'strings/string_split_unittest.cc', 582 'strings/string_tokenizer_unittest.cc', 583 'strings/string_util_unittest.cc', 584 'strings/stringize_macros_unittest.cc', 585 'strings/sys_string_conversions_mac_unittest.mm', 586 'strings/sys_string_conversions_unittest.cc', 587 'strings/utf_offset_string_conversions_unittest.cc', 588 'strings/utf_string_conversions_unittest.cc', 589 'synchronization/cancellation_flag_unittest.cc', 590 'synchronization/condition_variable_unittest.cc', 591 'synchronization/lock_unittest.cc', 592 'synchronization/waitable_event_unittest.cc', 593 'synchronization/waitable_event_watcher_unittest.cc', 594 'sys_info_unittest.cc', 595 'system_monitor/system_monitor_unittest.cc', 596 'task_runner_util_unittest.cc', 597 'template_util_unittest.cc', 598 'test/expectations/expectation_unittest.cc', 599 'test/expectations/parser_unittest.cc', 600 'test/trace_event_analyzer_unittest.cc', 601 'threading/non_thread_safe_unittest.cc', 602 'threading/platform_thread_unittest.cc', 603 'threading/sequenced_worker_pool_unittest.cc', 604 'threading/simple_thread_unittest.cc', 605 'threading/thread_checker_unittest.cc', 606 'threading/thread_collision_warner_unittest.cc', 607 'threading/thread_id_name_manager_unittest.cc', 608 'threading/thread_local_storage_unittest.cc', 609 'threading/thread_local_unittest.cc', 610 'threading/thread_unittest.cc', 611 'threading/watchdog_unittest.cc', 612 'threading/worker_pool_posix_unittest.cc', 613 'threading/worker_pool_unittest.cc', 614 'time/pr_time_unittest.cc', 615 'time/time_unittest.cc', 616 'time/time_win_unittest.cc', 617 'timer/hi_res_timer_manager_unittest.cc', 618 'timer/timer_unittest.cc', 619 'tools_sanity_unittest.cc', 620 'tracked_objects_unittest.cc', 621 'tuple_unittest.cc', 622 'values_unittest.cc', 623 'version_unittest.cc', 624 'vlog_unittest.cc', 625 'win/dllmain.cc', 626 'win/enum_variant_unittest.cc', 627 'win/event_trace_consumer_unittest.cc', 628 'win/event_trace_controller_unittest.cc', 629 'win/event_trace_provider_unittest.cc', 630 'win/i18n_unittest.cc', 631 'win/iunknown_impl_unittest.cc', 632 'win/message_window_unittest.cc', 633 'win/object_watcher_unittest.cc', 634 'win/pe_image_unittest.cc', 635 'win/registry_unittest.cc', 636 'win/sampling_profiler_unittest.cc', 637 'win/scoped_bstr_unittest.cc', 638 'win/scoped_comptr_unittest.cc', 639 'win/scoped_handle_unittest.cc', 640 'win/scoped_process_information_unittest.cc', 641 'win/scoped_variant_unittest.cc', 642 'win/shortcut_unittest.cc', 643 'win/startup_information_unittest.cc', 644 'win/win_util_unittest.cc', 645 'win/wrapped_window_proc_unittest.cc', 646 ], 647 'dependencies': [ 648 'base', 649 'base_i18n', 650 'base_prefs', 651 'base_prefs_test_support', 652 'base_static', 653 'run_all_unittests', 654 'test_support_base', 655 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', 656 '../testing/gmock.gyp:gmock', 657 '../testing/gtest.gyp:gtest', 658 '../third_party/icu/icu.gyp:icui18n', 659 '../third_party/icu/icu.gyp:icuuc', 660 ], 661 'includes': ['../build/nocompile.gypi'], 662 'variables': { 663 # TODO(ajwong): Is there a way to autodetect this? 664 'module_dir': 'base' 665 }, 666 'conditions': [ 667 ['use_glib==1', { 668 'defines': [ 669 'USE_SYMBOLIZE', 670 ], 671 }], 672 ['OS == "android"', { 673 'dependencies': [ 674 'android/jni_generator/jni_generator.gyp:jni_generator_tests', 675 ], 676 'conditions': [ 677 ['gtest_target_type == "shared_library"', { 678 'dependencies': [ 679 '../testing/android/native_test.gyp:native_test_native_code', 680 ], 681 }], 682 ], 683 }], 684 ['OS == "ios" and _toolset != "host"', { 685 'sources/': [ 686 # Only test the iOS-meaningful portion of process_utils. 687 ['exclude', '^process/memory_unittest'], 688 ['exclude', '^process/process_util_unittest\\.cc$'], 689 ['include', '^process/process_util_unittest_ios\\.cc$'], 690 # Requires spawning processes. 691 ['exclude', '^metrics/stats_table_unittest\\.cc$'], 692 # iOS does not use message_pump_libevent. 693 ['exclude', '^message_loop/message_pump_libevent_unittest\\.cc$'], 694 ], 695 'conditions': [ 696 ['coverage != 0', { 697 'sources!': [ 698 # These sources can't be built with coverage due to a toolchain 699 # bug: http://openradar.appspot.com/radar?id=1499403 700 'json/json_reader_unittest.cc', 701 'strings/string_piece_unittest.cc', 702 703 # These tests crash when run with coverage turned on due to an 704 # issue with llvm_gcda_increment_indirect_counter: 705 # http://crbug.com/156058 706 'debug/trace_event_unittest.cc', 707 'debug/trace_event_unittest.h', 708 'logging_unittest.cc', 709 'string_util_unittest.cc', 710 'test/trace_event_analyzer_unittest.cc', 711 'utf_offset_string_conversions_unittest.cc', 712 ], 713 }], 714 ], 715 'actions': [ 716 { 717 'action_name': 'copy_test_data', 718 'variables': { 719 'test_data_files': [ 720 'test/data', 721 ], 722 'test_data_prefix': 'base', 723 }, 724 'includes': [ '../build/copy_test_data_ios.gypi' ], 725 }, 726 ], 727 }], 728 ['use_glib==1', { 729 'sources!': [ 730 'file_version_info_unittest.cc', 731 ], 732 'conditions': [ 733 [ 'toolkit_uses_gtk==1', { 734 'sources': [ 735 'nix/xdg_util_unittest.cc', 736 ], 737 'dependencies': [ 738 '../build/linux/system.gyp:gtk', 739 ] 740 }], 741 ], 742 'dependencies': [ 743 '../build/linux/system.gyp:glib', 744 '../build/linux/system.gyp:ssl', 745 '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck', 746 ], 747 }, { # use_glib!=1 748 'sources!': [ 749 'message_loop/message_pump_glib_unittest.cc', 750 ] 751 }], 752 ['use_ozone == 1', { 753 'sources!': [ 754 'message_loop/message_pump_glib_unittest.cc', 755 ] 756 }], 757 ['OS == "linux" and linux_use_tcmalloc==1', { 758 'dependencies': [ 759 'allocator/allocator.gyp:allocator', 760 ], 761 }, 762 ], 763 ['OS == "win"', { 764 # This is needed to trigger the dll copy step on windows. 765 # TODO(mark): This should not be necessary. 766 'dependencies': [ 767 '../third_party/icu/icu.gyp:icudata', 768 ], 769 'sources!': [ 770 'file_descriptor_shuffle_unittest.cc', 771 'files/dir_reader_posix_unittest.cc', 772 'threading/worker_pool_posix_unittest.cc', 773 'message_loop/message_pump_libevent_unittest.cc', 774 ], 775 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 776 'msvs_disabled_warnings': [ 777 4267, 778 ], 779 # This is needed so base_unittests uses the allocator shim, as 780 # SecurityTest.MemoryAllocationRestriction* tests are dependent 781 # on tcmalloc. 782 # TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into 783 # their own test suite. 784 'conditions': [ 785 ['win_use_allocator_shim==1', { 786 'dependencies': [ 787 'allocator/allocator.gyp:allocator', 788 ], 789 }], 790 ], 791 }, { # OS != "win" 792 'dependencies': [ 793 '../third_party/libevent/libevent.gyp:libevent' 794 ], 795 'sources/': [ 796 ['exclude', '^win/'], 797 ], 798 'sources!': [ 799 'debug/trace_event_win_unittest.cc', 800 'time/time_win_unittest.cc', 801 'win/win_util_unittest.cc', 802 ], 803 }], 804 ['use_system_nspr==1', { 805 'dependencies': [ 806 'third_party/nspr/nspr.gyp:nspr', 807 ], 808 }], 809 ], # conditions 810 'target_conditions': [ 811 ['OS == "ios" and _toolset != "host"', { 812 'sources/': [ 813 # Pull in specific Mac files for iOS (which have been filtered out 814 # by file name rules). 815 ['include', '^mac/objc_property_releaser_unittest\\.mm$'], 816 ['include', '^mac/bind_objc_block_unittest\\.mm$'], 817 ['include', '^mac/scoped_nsobject_unittest\\.mm$'], 818 ['include', '^sys_string_conversions_mac_unittest\\.mm$'], 819 ], 820 }], 821 ['OS == "android"', { 822 'sources/': [ 823 ['include', '^debug/proc_maps_linux_unittest\\.cc$'], 824 ], 825 }], 826 ], # target_conditions 827 }, 828 { 829 'target_name': 'test_support_base', 830 'type': 'static_library', 831 'dependencies': [ 832 'base', 833 'base_static', 834 'base_i18n', 835 '../testing/gmock.gyp:gmock', 836 '../testing/gtest.gyp:gtest', 837 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', 838 ], 839 'export_dependent_settings': [ 840 'base', 841 ], 842 'conditions': [ 843 ['toolkit_uses_gtk==1', { 844 'dependencies': [ 845 # test_suite initializes GTK. 846 '../build/linux/system.gyp:gtk', 847 ], 848 }], 849 ['os_posix==0', { 850 'sources!': [ 851 'test/scoped_locale.cc', 852 'test/scoped_locale.h', 853 ], 854 }], 855 ['os_bsd==1', { 856 'sources!': [ 857 'test/test_file_util_linux.cc', 858 ], 859 }], 860 ], 861 'sources': [ 862 'perftimer.cc', 863 'test/expectations/expectation.cc', 864 'test/expectations/expectation.h', 865 'test/expectations/parser.cc', 866 'test/expectations/parser.h', 867 'test/mock_chrome_application_mac.h', 868 'test/mock_chrome_application_mac.mm', 869 'test/mock_devices_changed_observer.cc', 870 'test/mock_devices_changed_observer.h', 871 'test/mock_time_provider.cc', 872 'test/mock_time_provider.h', 873 'test/multiprocess_test.cc', 874 'test/multiprocess_test.h', 875 'test/multiprocess_test_android.cc', 876 'test/null_task_runner.cc', 877 'test/null_task_runner.h', 878 'test/perf_test_suite.cc', 879 'test/perf_test_suite.h', 880 'test/power_monitor_test_base.cc', 881 'test/power_monitor_test_base.h', 882 'test/scoped_locale.cc', 883 'test/scoped_locale.h', 884 'test/scoped_path_override.cc', 885 'test/scoped_path_override.h', 886 'test/sequenced_task_runner_test_template.cc', 887 'test/sequenced_task_runner_test_template.h', 888 'test/sequenced_worker_pool_owner.cc', 889 'test/sequenced_worker_pool_owner.h', 890 'test/simple_test_clock.cc', 891 'test/simple_test_clock.h', 892 'test/simple_test_tick_clock.cc', 893 'test/simple_test_tick_clock.h', 894 'test/task_runner_test_template.cc', 895 'test/task_runner_test_template.h', 896 'test/test_file_util.cc', 897 'test/test_file_util.h', 898 'test/test_file_util_linux.cc', 899 'test/test_file_util_mac.cc', 900 'test/test_file_util_posix.cc', 901 'test/test_file_util_win.cc', 902 'test/test_launcher.cc', 903 'test/test_launcher.h', 904 'test/test_listener_ios.h', 905 'test/test_listener_ios.mm', 906 'test/test_pending_task.cc', 907 'test/test_pending_task.h', 908 'test/test_process_killer_win.cc', 909 'test/test_process_killer_win.h', 910 'test/test_reg_util_win.cc', 911 'test/test_reg_util_win.h', 912 'test/test_shortcut_win.cc', 913 'test/test_shortcut_win.h', 914 'test/test_simple_task_runner.cc', 915 'test/test_simple_task_runner.h', 916 'test/test_suite.cc', 917 'test/test_suite.h', 918 'test/test_support_android.cc', 919 'test/test_support_android.h', 920 'test/test_support_ios.h', 921 'test/test_support_ios.mm', 922 'test/test_switches.cc', 923 'test/test_switches.h', 924 'test/test_timeouts.cc', 925 'test/test_timeouts.h', 926 'test/thread_test_helper.cc', 927 'test/thread_test_helper.h', 928 'test/trace_event_analyzer.cc', 929 'test/trace_event_analyzer.h', 930 'test/values_test_util.cc', 931 'test/values_test_util.h', 932 ], 933 'target_conditions': [ 934 ['OS == "ios"', { 935 'sources/': [ 936 # Pull in specific Mac files for iOS (which have been filtered out 937 # by file name rules). 938 ['include', '^test/test_file_util_mac\\.cc$'], 939 ], 940 }], 941 ], # target_conditions 942 }, 943 { 944 'target_name': 'test_support_perf', 945 'type': 'static_library', 946 'dependencies': [ 947 'base', 948 '../testing/gtest.gyp:gtest', 949 ], 950 'sources': [ 951 'perftimer.cc', 952 'test/run_all_perftests.cc', 953 ], 954 'direct_dependent_settings': { 955 'defines': [ 956 'PERF_TEST', 957 ], 958 }, 959 'conditions': [ 960 ['toolkit_uses_gtk==1', { 961 'dependencies': [ 962 # Needed to handle the #include chain: 963 # base/test/perf_test_suite.h 964 # base/test/test_suite.h 965 # gtk/gtk.h 966 '../build/linux/system.gyp:gtk', 967 ], 968 }], 969 ], 970 }, 971 ], 972 'conditions': [ 973 ['OS!="ios"', { 974 'targets': [ 975 { 976 'target_name': 'check_example', 977 'type': 'executable', 978 'sources': [ 979 'check_example.cc', 980 ], 981 'dependencies': [ 982 'base', 983 ], 984 }, 985 ], 986 }], 987 ['OS == "win" and target_arch=="ia32"', { 988 'targets': [ 989 { 990 'target_name': 'base_nacl_win64', 991 'type': '<(component)', 992 'variables': { 993 'base_target': 1, 994 }, 995 'dependencies': [ 996 'base_static_win64', 997 'allocator/allocator.gyp:allocator_extension_thunks_win64', 998 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64', 999 ], 1000 # TODO(gregoryd): direct_dependent_settings should be shared with the 1001 # 32-bit target, but it doesn't work due to a bug in gyp 1002 'direct_dependent_settings': { 1003 'include_dirs': [ 1004 '..', 1005 ], 1006 }, 1007 'defines': [ 1008 '<@(nacl_win64_defines)', 1009 ], 1010 'sources!': [ 1011 # base64.cc depends on modp_b64. 1012 'base64.cc', 1013 ], 1014 'configurations': { 1015 'Common_Base': { 1016 'msvs_target_platform': 'x64', 1017 }, 1018 }, 1019 'conditions': [ 1020 ['component == "shared_library"', { 1021 'sources!': [ 1022 'debug/debug_on_start_win.cc', 1023 ], 1024 }], 1025 ], 1026 }, 1027 { 1028 'target_name': 'base_i18n_nacl_win64', 1029 'type': '<(component)', 1030 # TODO(gregoryd): direct_dependent_settings should be shared with the 1031 # 32-bit target, but it doesn't work due to a bug in gyp 1032 'direct_dependent_settings': { 1033 'include_dirs': [ 1034 '..', 1035 ], 1036 }, 1037 'defines': [ 1038 '<@(nacl_win64_defines)', 1039 'BASE_I18N_IMPLEMENTATION', 1040 ], 1041 'include_dirs': [ 1042 '..', 1043 ], 1044 'sources': [ 1045 'i18n/icu_util_nacl_win64.cc', 1046 ], 1047 'configurations': { 1048 'Common_Base': { 1049 'msvs_target_platform': 'x64', 1050 }, 1051 }, 1052 }, 1053 { 1054 # TODO(rvargas): Remove this when gyp finally supports a clean model. 1055 # See bug 36232. 1056 'target_name': 'base_static_win64', 1057 'type': 'static_library', 1058 'sources': [ 1059 'base_switches.cc', 1060 'base_switches.h', 1061 'win/pe_image.cc', 1062 'win/pe_image.h', 1063 ], 1064 'sources!': [ 1065 # base64.cc depends on modp_b64. 1066 'base64.cc', 1067 ], 1068 'include_dirs': [ 1069 '..', 1070 ], 1071 'configurations': { 1072 'Common_Base': { 1073 'msvs_target_platform': 'x64', 1074 }, 1075 }, 1076 'defines': [ 1077 'NACL_WIN64', 1078 ], 1079 # TODO(rvargas): Bug 78117. Remove this. 1080 'msvs_disabled_warnings': [ 1081 4244, 1082 ], 1083 }, 1084 ], 1085 }], 1086 ['os_posix==1 and OS!="mac" and OS!="ios"', { 1087 'targets': [ 1088 { 1089 'target_name': 'symbolize', 1090 'type': 'static_library', 1091 'toolsets': ['host', 'target'], 1092 'variables': { 1093 'chromium_code': 0, 1094 }, 1095 'conditions': [ 1096 ['OS == "solaris"', { 1097 'include_dirs': [ 1098 '/usr/gnu/include', 1099 '/usr/gnu/include/libelf', 1100 ], 1101 },], 1102 ], 1103 'cflags': [ 1104 '-Wno-sign-compare', 1105 ], 1106 'cflags!': [ 1107 '-Wextra', 1108 ], 1109 'sources': [ 1110 'third_party/symbolize/config.h', 1111 'third_party/symbolize/demangle.cc', 1112 'third_party/symbolize/demangle.h', 1113 'third_party/symbolize/glog/logging.h', 1114 'third_party/symbolize/glog/raw_logging.h', 1115 'third_party/symbolize/symbolize.cc', 1116 'third_party/symbolize/symbolize.h', 1117 'third_party/symbolize/utilities.h', 1118 ], 1119 'include_dirs': [ 1120 '..', 1121 ], 1122 }, 1123 { 1124 'target_name': 'xdg_mime', 1125 'type': 'static_library', 1126 'toolsets': ['host', 'target'], 1127 'variables': { 1128 'chromium_code': 0, 1129 }, 1130 'cflags!': [ 1131 '-Wextra', 1132 ], 1133 'sources': [ 1134 'third_party/xdg_mime/xdgmime.c', 1135 'third_party/xdg_mime/xdgmime.h', 1136 'third_party/xdg_mime/xdgmimealias.c', 1137 'third_party/xdg_mime/xdgmimealias.h', 1138 'third_party/xdg_mime/xdgmimecache.c', 1139 'third_party/xdg_mime/xdgmimecache.h', 1140 'third_party/xdg_mime/xdgmimeglob.c', 1141 'third_party/xdg_mime/xdgmimeglob.h', 1142 'third_party/xdg_mime/xdgmimeicon.c', 1143 'third_party/xdg_mime/xdgmimeicon.h', 1144 'third_party/xdg_mime/xdgmimeint.c', 1145 'third_party/xdg_mime/xdgmimeint.h', 1146 'third_party/xdg_mime/xdgmimemagic.c', 1147 'third_party/xdg_mime/xdgmimemagic.h', 1148 'third_party/xdg_mime/xdgmimeparent.c', 1149 'third_party/xdg_mime/xdgmimeparent.h', 1150 ], 1151 }, 1152 ], 1153 }], 1154 ['OS == "android"', { 1155 'targets': [ 1156 { 1157 'target_name': 'base_jni_headers', 1158 'type': 'none', 1159 'sources': [ 1160 'android/java/src/org/chromium/base/ActivityStatus.java', 1161 'android/java/src/org/chromium/base/BuildInfo.java', 1162 'android/java/src/org/chromium/base/CpuFeatures.java', 1163 'android/java/src/org/chromium/base/ImportantFileWriterAndroid.java', 1164 'android/java/src/org/chromium/base/MemoryPressureListener.java', 1165 'android/java/src/org/chromium/base/JavaHandlerThread.java', 1166 'android/java/src/org/chromium/base/PathService.java', 1167 'android/java/src/org/chromium/base/PathUtils.java', 1168 'android/java/src/org/chromium/base/PowerMonitor.java', 1169 'android/java/src/org/chromium/base/SystemMessageHandler.java', 1170 'android/java/src/org/chromium/base/SysUtils.java', 1171 'android/java/src/org/chromium/base/ThreadUtils.java', 1172 ], 1173 'conditions': [ 1174 ['google_tv==1', { 1175 'sources': [ 1176 'android/java/src/org/chromium/base/ContextTypes.java', 1177 ], 1178 }], 1179 ], 1180 'variables': { 1181 'jni_gen_package': 'base', 1182 }, 1183 'includes': [ '../build/jni_generator.gypi' ], 1184 }, 1185 { 1186 'target_name': 'base_java', 1187 'type': 'none', 1188 'variables': { 1189 'java_in_dir': '../base/android/java', 1190 }, 1191 'dependencies': [ 1192 'base_java_activity_state', 1193 'base_java_memory_pressure_level_list', 1194 ], 1195 'includes': [ '../build/java.gypi' ], 1196 'conditions': [ 1197 ['android_webview_build==0', { 1198 'dependencies': [ 1199 '../third_party/jsr-305/jsr-305.gyp:jsr_305_javalib', 1200 ], 1201 }] 1202 ], 1203 }, 1204 { 1205 'target_name': 'base_java_activity_state', 1206 'type': 'none', 1207 # This target is used to auto-generate ActivityState.java 1208 # from a template file. The source file contains a list of 1209 # Java constant declarations matching the ones in 1210 # android/activity_state_list.h. 1211 'sources': [ 1212 'android/java/src/org/chromium/base/ActivityState.template', 1213 ], 1214 'variables': { 1215 'package_name': 'org/chromium/base', 1216 'template_deps': ['android/activity_state_list.h'], 1217 }, 1218 'includes': [ '../build/android/java_cpp_template.gypi' ], 1219 }, 1220 { 1221 'target_name': 'base_java_memory_pressure_level_list', 1222 'type': 'none', 1223 'sources': [ 1224 'android/java/src/org/chromium/base/MemoryPressureLevelList.template', 1225 ], 1226 'variables': { 1227 'package_name': 'org/chromium/base', 1228 'template_deps': ['memory/memory_pressure_level_list.h'], 1229 }, 1230 'includes': [ '../build/android/java_cpp_template.gypi' ], 1231 }, 1232 { 1233 'target_name': 'base_java_test_support', 1234 'type': 'none', 1235 'dependencies': [ 1236 'base_java', 1237 ], 1238 'variables': { 1239 'java_in_dir': '../base/test/android/javatests', 1240 }, 1241 'includes': [ '../build/java.gypi' ], 1242 }, 1243 { 1244 'target_name': 'base_javatests', 1245 'type': 'none', 1246 'dependencies': [ 1247 'base_java', 1248 'base_java_test_support', 1249 ], 1250 'variables': { 1251 'java_in_dir': '../base/android/javatests', 1252 }, 1253 'includes': [ '../build/java.gypi' ], 1254 }, 1255 ], 1256 }], 1257 ['OS == "win"', { 1258 'targets': [ 1259 { 1260 'target_name': 'debug_message', 1261 'type': 'executable', 1262 'sources': [ 1263 'debug_message.cc', 1264 ], 1265 'msvs_settings': { 1266 'VCLinkerTool': { 1267 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS 1268 }, 1269 }, 1270 }, 1271 ], 1272 }], 1273 # Special target to wrap a gtest_target_type == shared_library 1274 # base_unittests into an android apk for execution. 1275 # TODO(jrg): lib.target comes from _InstallableTargetInstallPath() 1276 # in the gyp make generator. What is the correct way to extract 1277 # this path from gyp and into 'raw' for input to antfiles? 1278 # Hard-coding in the gypfile seems a poor choice. 1279 ['OS == "android" and gtest_target_type == "shared_library"', { 1280 'targets': [ 1281 { 1282 'target_name': 'base_unittests_apk', 1283 'type': 'none', 1284 'dependencies': [ 1285 'base_java', 1286 'base_unittests', 1287 ], 1288 'variables': { 1289 'test_suite_name': 'base_unittests', 1290 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)base_unittests<(SHARED_LIB_SUFFIX)', 1291 }, 1292 'includes': [ '../build/apk_test.gypi' ], 1293 }, 1294 ], 1295 }], 1296 ['test_isolation_mode != "noop"', { 1297 'targets': [ 1298 { 1299 'target_name': 'base_unittests_run', 1300 'type': 'none', 1301 'dependencies': [ 1302 'base_unittests', 1303 ], 1304 'includes': [ 1305 '../build/isolate.gypi', 1306 'base_unittests.isolate', 1307 ], 1308 'sources': [ 1309 'base_unittests.isolate', 1310 ], 1311 }, 1312 ], 1313 }], 1314 ], 1315 } 1316