base.gypi revision 731df977c0511bca2206b5f333555b1205ff1f43
1# Copyright (c) 2010 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 'target_defaults': { 7 'variables': { 8 'base_target': 0, 9 'base_extra_target': 0, 10 }, 11 'target_conditions': [ 12 # This part is shared between the targets defined below. 13 ['base_target==1', { 14 'sources': [ 15 '../build/build_config.h', 16 'third_party/dmg_fp/dmg_fp.h', 17 'third_party/dmg_fp/dtoa.cc', 18 'third_party/dmg_fp/g_fmt.cc', 19 'third_party/icu/icu_utf.cc', 20 'third_party/icu/icu_utf.h', 21 'third_party/nspr/prtime.cc', 22 'third_party/nspr/prtime.h', 23 'at_exit.cc', 24 'at_exit.h', 25 'atomic_ref_count.h', 26 'atomic_sequence_num.h', 27 'atomicops.h', 28 'atomicops_internals_x86_gcc.cc', 29 'atomicops_internals_x86_msvc.h', 30 'base_paths.cc', 31 'base_paths.h', 32 'base_paths_mac.h', 33 'base_paths_mac.mm', 34 'base_paths_linux.cc', 35 'base_paths_win.cc', 36 'base_paths_win.h', 37 'base_switches.cc', 38 'base_switches.h', 39 'basictypes.h', 40 'bits.h', 41 'bzip2_error_handler.cc', 42 'callback.h', 43 'cancellation_flag.cc', 44 'cancellation_flag.h', 45 'chrome_application_mac.h', 46 'chrome_application_mac.mm', 47 'cocoa_protocols_mac.h', 48 'command_line.cc', 49 'command_line.h', 50 'compiler_specific.h', 51 'condition_variable.h', 52 'condition_variable_posix.cc', 53 'condition_variable_win.cc', 54 'cpu.cc', 55 'cpu.h', 56 'debug_on_start.cc', 57 'debug_on_start.h', 58 'debug_util.cc', 59 'debug_util.h', 60 'debug_util_mac.cc', 61 'debug_util_posix.cc', 62 'debug_util_win.cc', 63 'dir_reader_fallback.h', 64 'dir_reader_linux.h', 65 'dir_reader_posix.h', 66 'environment.cc', 67 'environment.h', 68 'event_trace_consumer_win.h', 69 'event_trace_controller_win.cc', 70 'event_trace_controller_win.h', 71 'event_trace_provider_win.cc', 72 'event_trace_provider_win.h', 73 'file_path.cc', 74 'file_path.h', 75 'file_util.cc', 76 'file_util.h', 77 'file_util_deprecated.h', 78 'file_util_linux.cc', 79 'file_util_mac.mm', 80 'file_util_posix.cc', 81 'file_util_win.cc', 82 'file_util_proxy.cc', 83 'file_util_proxy.h', 84 'file_version_info.h', 85 'file_version_info_mac.h', 86 'file_version_info_mac.mm', 87 'file_version_info_win.cc', 88 'file_version_info_win.h', 89 'fix_wp64.h', 90 'float_util.h', 91 'foundation_utils_mac.h', 92 'global_descriptors_posix.cc', 93 'global_descriptors_posix.h', 94 'gtest_prod_util.h', 95 'gtk_util.cc', 96 'gtk_util.h', 97 'hash_tables.h', 98 'id_map.h', 99 'json/json_reader.cc', 100 'json/json_reader.h', 101 'json/json_writer.cc', 102 'json/json_writer.h', 103 'json/string_escape.cc', 104 'json/string_escape.h', 105 'lazy_instance.cc', 106 'lazy_instance.h', 107 'leak_annotations.h', 108 'leak_tracker.h', 109 'linked_list.h', 110 'linked_ptr.h', 111 'lock.cc', 112 'lock.h', 113 'lock_impl.h', 114 'lock_impl_posix.cc', 115 'lock_impl_win.cc', 116 'logging.cc', 117 'logging.h', 118 'logging_win.cc', 119 'mac_util.h', 120 'mac_util.mm', 121 'mac/scoped_aedesc.h', 122 'mac/scoped_nsautorelease_pool.h', 123 'mac/scoped_nsautorelease_pool.mm', 124 'mach_ipc_mac.h', 125 'mach_ipc_mac.mm', 126 'memory_debug.cc', 127 'memory_debug.h', 128 'message_loop.cc', 129 'message_loop.h', 130 'message_loop_proxy.cc', 131 'message_loop_proxy.h', 132 'message_loop_proxy_impl.cc', 133 'message_loop_proxy_impl.h', 134 'message_pump.cc', 135 'message_pump.h', 136 'message_pump_default.cc', 137 'message_pump_default.h', 138 'message_pump_win.cc', 139 'message_pump_win.h', 140 'metrics/histogram.cc', 141 'metrics/histogram.h', 142 'metrics/stats_counters.cc', 143 'metrics/stats_counters.h', 144 'metrics/stats_table.cc', 145 'metrics/stats_table.h', 146 'mime_util.h', 147 'mime_util_xdg.cc', 148 'move.h', 149 'native_library.h', 150 'native_library_linux.cc', 151 'native_library_mac.mm', 152 'native_library_win.cc', 153 'non_thread_safe.cc', 154 'non_thread_safe.h', 155 'nullable_string16.h', 156 'object_watcher.cc', 157 'object_watcher.h', 158 'observer_list.h', 159 'observer_list_threadsafe.h', 160 'path_service.cc', 161 'path_service.h', 162 'pickle.cc', 163 'pickle.h', 164 'platform_file.h', 165 'platform_file_posix.cc', 166 'platform_file_win.cc', 167 'platform_thread.h', 168 'platform_thread_mac.mm', 169 'platform_thread_posix.cc', 170 'platform_thread_win.cc', 171 'port.h', 172 'process.h', 173 'process_linux.cc', 174 'process_posix.cc', 175 'process_util.cc', 176 'process_util.h', 177 'process_util_linux.cc', 178 'process_util_mac.mm', 179 'process_util_posix.cc', 180 'process_util_win.cc', 181 'process_win.cc', 182 'rand_util.cc', 183 'rand_util.h', 184 'rand_util_posix.cc', 185 'rand_util_win.cc', 186 'raw_scoped_refptr_mismatch_checker.h', 187 'ref_counted.cc', 188 'ref_counted.h', 189 'ref_counted_memory.cc', 190 'ref_counted_memory.h', 191 'resource_util.cc', 192 'resource_util.h', 193 'safe_strerror_posix.cc', 194 'safe_strerror_posix.h', 195 'scoped_callback_factory.h', 196 'scoped_cftyperef.h', 197 'scoped_handle.h', 198 'scoped_nsobject.h', 199 'scoped_open_process.h', 200 'scoped_ptr.h', 201 'scoped_temp_dir.cc', 202 'scoped_temp_dir.h', 203 'scoped_vector.h', 204 'sha1.h', 205 'sha1_portable.cc', 206 'sha1_win.cc', 207 'shared_memory.h', 208 'shared_memory_posix.cc', 209 'shared_memory_win.cc', 210 'simple_thread.cc', 211 'simple_thread.h', 212 'singleton.h', 213 'spin_wait.h', 214 'stack_container.h', 215 'stl_util-inl.h', 216 'string_number_conversions.cc', 217 'string_number_conversions.h', 218 'string_piece.cc', 219 'string_piece.h', 220 'string_split.cc', 221 'string_split.h', 222 'string_tokenizer.h', 223 'string_util.cc', 224 'string_util.h', 225 'string_util_win.h', 226 'stringprintf.cc', 227 'stringprintf.h', 228 'sys_info.h', 229 'sys_info_chromeos.cc', 230 'sys_info_freebsd.cc', 231 'sys_info_linux.cc', 232 'sys_info_mac.cc', 233 'sys_info_openbsd.cc', 234 'sys_info_posix.cc', 235 'sys_info_win.cc', 236 'sys_string_conversions.h', 237 'sys_string_conversions_linux.cc', 238 'sys_string_conversions_mac.mm', 239 'sys_string_conversions_win.cc', 240 'task.cc', 241 'task.h', 242 'task_queue.cc', 243 'task_queue.h', 244 'template_util.h', 245 'thread.cc', 246 'thread.h', 247 'thread_checker.cc', 248 'thread_checker.h', 249 'thread_collision_warner.cc', 250 'thread_collision_warner.h', 251 'thread_local.h', 252 'thread_local_posix.cc', 253 'thread_local_storage.h', 254 'thread_local_storage_posix.cc', 255 'thread_local_storage_win.cc', 256 'thread_local_win.cc', 257 'time.cc', 258 'time.h', 259 'time_win.cc', 260 'timer.cc', 261 'timer.h', 262 'trace_event_win.cc', 263 'trace_event.cc', 264 'trace_event.h', 265 'tracked.cc', 266 'tracked.h', 267 'tracked_objects.cc', 268 'tracked_objects.h', 269 'tuple.h', 270 'unix_domain_socket_posix.cc', 271 'utf_offset_string_conversions.cc', 272 'utf_offset_string_conversions.h', 273 'utf_string_conversion_utils.cc', 274 'utf_string_conversion_utils.h', 275 'utf_string_conversions.cc', 276 'utf_string_conversions.h', 277 'values.cc', 278 'values.h', 279 'vlog.cc', 280 'vlog.h', 281 'waitable_event.h', 282 'waitable_event_posix.cc', 283 'waitable_event_watcher.h', 284 'waitable_event_watcher_posix.cc', 285 'waitable_event_watcher_win.cc', 286 'waitable_event_win.cc', 287 'watchdog.cc', 288 'watchdog.h', 289 'weak_ptr.cc', 290 'weak_ptr.h', 291 'win/pe_image.cc', 292 'win/pe_image.h', 293 'win/registry.cc', 294 'win/registry.h', 295 'win/scoped_bstr.cc', 296 'win/scoped_bstr.h', 297 'win/scoped_comptr.h', 298 'win/scoped_gdi_object.h', 299 'win/scoped_handle.h', 300 'win/scoped_hdc.h', 301 'win/scoped_hglobal.h', 302 'win/scoped_variant.cc', 303 'win/scoped_variant.h', 304 'win/windows_version.cc', 305 'win/windows_version.h', 306 'win_util.cc', 307 'win_util.h', 308 'windows_message_list.h', 309 'worker_pool.h', 310 'worker_pool_linux.cc', 311 'worker_pool_linux.h', 312 'worker_pool_mac.h', 313 'worker_pool_mac.mm', 314 'worker_pool_win.cc', 315 'nix/xdg_util.h', 316 'nix/xdg_util.cc', 317 ], 318 'include_dirs': [ 319 '..', 320 ], 321 # These warnings are needed for the files in third_party\dmg_fp. 322 'msvs_disabled_warnings': [ 323 4244, 4554, 4018, 4102, 324 ], 325 'mac_framework_dirs': [ 326 '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks', 327 ], 328 'conditions': [ 329 [ 'OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris"', { 330 'sources/': [ 331 ['exclude', '^nix/'], 332 ], 333 'sources!': [ 334 'atomicops_internals_x86_gcc.cc', 335 'message_pump_glib.cc', 336 ], 337 }], 338 [ 'OS != "linux"', { 339 'sources!': [ 340 # Not automatically excluded by the *linux.cc rules. 341 'gtk_util.cc', 342 'gtk_util.h', 343 'linux_util.cc', 344 'setproctitle_linux.c', 345 'setproctitle_linux.h', 346 ], 347 }, 348 ], 349 [ 'OS != "mac"', { 350 'sources!': [ 351 'scoped_aedesc.h' 352 ], 353 }], 354 # For now, just test the *BSD platforms enough to exclude them. 355 # Subsequent changes will include them further. 356 [ 'OS != "freebsd"', { 357 'sources/': [ ['exclude', '_freebsd\\.cc$'] ], 358 }, 359 ], 360 [ 'OS != "openbsd"', { 361 'sources/': [ ['exclude', '_openbsd\\.cc$'] ], 362 }, 363 ], 364 ['OS != "win"', { 365 'sources/': [ ['exclude', '^win/'] ], 366 }, 367 ], 368 [ 'OS == "win"', { 369 'include_dirs': [ 370 '<(DEPTH)/third_party/wtl/include', 371 ], 372 'sources!': [ 373 'event_recorder_stubs.cc', 374 'file_descriptor_shuffle.cc', 375 'message_pump_libevent.cc', 376 # Not using sha1_win.cc because it may have caused a 377 # regression to page cycler moz. 378 'sha1_win.cc', 379 'string16.cc', 380 'trace_event.cc', 381 ], 382 },], 383 ], 384 }], 385 ['base_extra_target==1', { 386 'sources': [ 387 'crypto/capi_util.cc', 388 'crypto/capi_util.h', 389 'crypto/cssm_init.cc', 390 'crypto/cssm_init.h', 391 'crypto/encryptor.h', 392 'crypto/encryptor_mac.cc', 393 'crypto/encryptor_nss.cc', 394 'crypto/encryptor_win.cc', 395 'crypto/rsa_private_key.h', 396 'crypto/rsa_private_key.cc', 397 'crypto/rsa_private_key_mac.cc', 398 'crypto/rsa_private_key_nss.cc', 399 'crypto/rsa_private_key_win.cc', 400 'crypto/signature_creator.h', 401 'crypto/signature_creator_mac.cc', 402 'crypto/signature_creator_nss.cc', 403 'crypto/signature_creator_win.cc', 404 'crypto/signature_verifier.h', 405 'crypto/signature_verifier_mac.cc', 406 'crypto/signature_verifier_nss.cc', 407 'crypto/signature_verifier_win.cc', 408 'crypto/symmetric_key.h', 409 'crypto/symmetric_key_mac.cc', 410 'crypto/symmetric_key_nss.cc', 411 'crypto/symmetric_key_win.cc', 412 'third_party/nspr/prcpucfg.h', 413 'third_party/nspr/prcpucfg_win.h', 414 'third_party/nspr/prtypes.h', 415 'third_party/nss/blapi.h', 416 'third_party/nss/blapit.h', 417 'third_party/nss/sha256.h', 418 'third_party/nss/sha512.cc', 419 'third_party/purify/pure.h', 420 'third_party/purify/pure_api.c', 421 'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', 422 'third_party/xdg_user_dirs/xdg_user_dir_lookup.h', 423 'auto_reset.h', 424 'base64.cc', 425 'base64.h', 426 'data_pack.cc', 427 'event_recorder.cc', 428 'event_recorder.h', 429 'event_recorder_stubs.cc', 430 'file_descriptor_shuffle.cc', 431 'file_descriptor_shuffle.h', 432 'hmac.h', 433 'hmac_mac.cc', 434 'hmac_nss.cc', 435 'hmac_win.cc', 436 'image_util.cc', 437 'image_util.h', 438 'linux_util.cc', 439 'linux_util.h', 440 'md5.cc', 441 'md5.h', 442 'message_pump_glib.cc', 443 'message_pump_glib.h', 444 'message_pump_libevent.cc', 445 'message_pump_libevent.h', 446 'message_pump_mac.h', 447 'message_pump_mac.mm', 448 'metrics/field_trial.cc', 449 'metrics/field_trial.h', 450 'nsimage_cache_mac.h', 451 'nsimage_cache_mac.mm', 452 'nss_util.cc', 453 'nss_util.h', 454 'setproctitle_linux.c', 455 'setproctitle_linux.h', 456 'sha2.cc', 457 'sha2.h', 458 'string16.cc', 459 'string16.h', 460 'sync_socket.h', 461 'sync_socket_win.cc', 462 'sync_socket_posix.cc', 463 'thread_restrictions.h', 464 'thread_restrictions.cc', 465 'time_mac.cc', 466 'time_posix.cc', 467 'version.cc', 468 'version.h', 469 ], 470 'conditions': [ 471 [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', { 472 'conditions': [ 473 [ 'chromeos==1', { 474 'sources/': [ ['include', '_chromeos\\.cc$'] ] 475 }, 476 ], 477 ], 478 'defines': [ 479 'USE_SYMBOLIZE', 480 ], 481 'cflags': [ 482 '-Wno-write-strings', 483 ], 484 }, { # OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris" 485 'sources/': [ 486 ['exclude', '/xdg_user_dirs/'], 487 ['exclude', '_nss\.cc$'], 488 ], 489 }], 490 [ 'OS != "mac"', { 491 'sources!': [ 492 'crypto/cssm_init.cc', 493 'crypto/cssm_init.h', 494 ], 495 },], 496 [ 'OS != "win"', { 497 'sources!': [ 498 'third_party/purify/pure_api.c', 499 'base_drag_source.cc', 500 'base_drop_target.cc', 501 'cpu.cc', 502 'crypto/capi_util.h', 503 'crypto/capi_util.cc', 504 'debug_on_start.cc', 505 'event_recorder.cc', 506 'file_version_info.cc', 507 'image_util.cc', 508 'object_watcher.cc', 509 'pe_image.cc', 510 'registry.cc', 511 'resource_util.cc', 512 'win_util.cc', 513 ], 514 },], 515 ], 516 }], 517 ], 518 }, 519 'targets': [ 520 { 521 'target_name': 'base', 522 'type': '<(library)', 523 'msvs_guid': '1832A374-8A74-4F9E-B536-69A699B3E165', 524 'variables': { 525 'base_target': 1, 526 'base_extra_target': 1, 527 }, 528 'dependencies': [ 529 '../third_party/modp_b64/modp_b64.gyp:modp_b64', 530 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', 531 ], 532 # TODO(gregoryd): direct_dependent_settings should be shared with the 533 # 64-bit target, but it doesn't work due to a bug in gyp 534 'direct_dependent_settings': { 535 'include_dirs': [ 536 '..', 537 ], 538 }, 539 'conditions': [ 540 [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd"', { 541 'conditions': [ 542 [ 'linux_use_tcmalloc==0', { 543 'defines': [ 544 'NO_TCMALLOC', 545 ], 546 'direct_dependent_settings': { 547 'defines': [ 548 'NO_TCMALLOC', 549 ], 550 }, 551 }, 552 ], 553 ], 554 'dependencies': [ 555 'symbolize', 556 '../build/util/build_util.gyp:lastchange', 557 '../build/linux/system.gyp:gtk', 558 '../build/linux/system.gyp:nss', 559 'xdg_mime', 560 ], 561 'export_dependent_settings': [ 562 '../build/linux/system.gyp:gtk', 563 ], 564 },], 565 [ 'OS == "freebsd" or OS == "openbsd"', { 566 'link_settings': { 567 'libraries': [ 568 '-L/usr/local/lib -lexecinfo', 569 ], 570 }, 571 }, 572 ], 573 [ 'OS == "linux"', { 574 'link_settings': { 575 'libraries': [ 576 # We need rt for clock_gettime(). 577 '-lrt', 578 # For 'native_library_linux.cc' 579 '-ldl', 580 ], 581 }, 582 }], 583 [ 'OS == "mac"', { 584 'link_settings': { 585 'libraries': [ 586 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', 587 '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', 588 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', 589 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', 590 '$(SDKROOT)/System/Library/Frameworks/IOKit.framework', 591 '$(SDKROOT)/System/Library/Frameworks/Security.framework', 592 ], 593 }, 594 },], 595 [ 'OS == "mac" or OS == "win"', { 596 'dependencies': [ 597 '../third_party/nss/nss.gyp:nss', 598 ], 599 },], 600 [ 'OS != "win"', { 601 'dependencies': ['../third_party/libevent/libevent.gyp:libevent'], 602 },], 603 ], 604 }, 605 ], 606 'conditions': [ 607 [ 'OS == "win"', { 608 'targets': [ 609 { 610 'target_name': 'base_nacl_win64', 611 'type': '<(library)', 612 'msvs_guid': 'CEE1F794-DC70-4FED-B7C4-4C12986672FE', 613 'variables': { 614 'base_target': 1, 615 }, 616 'dependencies': [ 617 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64', 618 ], 619 # TODO(gregoryd): direct_dependent_settings should be shared with the 620 # 32-bit target, but it doesn't work due to a bug in gyp 621 'direct_dependent_settings': { 622 'include_dirs': [ 623 '..', 624 ], 625 }, 626 'defines': [ 627 '<@(nacl_win64_defines)', 628 ], 629 'sources': [ 630 'i18n/icu_util_nacl_win64.cc', 631 ], 632 'configurations': { 633 'Common_Base': { 634 'msvs_target_platform': 'x64', 635 }, 636 }, 637 }, 638 ], 639 }], 640 [ 'OS == "linux" and internal_pdf', { 641 'targets': [ 642 { 643 'target_name': 'base_fpic', 644 'type': '<(library)', 645 'variables': { 646 'base_target': 1, 647 'base_extra_target': 1, 648 }, 649 'cflags': [ 650 '-fPIC', 651 ], 652 'direct_dependent_settings': { 653 'include_dirs': [ 654 '..', 655 ], 656 }, 657 'conditions': [ 658 [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd"', { 659 'dependencies': [ 660 '../build/util/build_util.gyp:lastchange', 661 '../build/linux/system.gyp:gtk', 662 '../build/linux/system.gyp:nss', 663 'xdg_mime', 664 ], 665 'export_dependent_settings': [ 666 '../build/linux/system.gyp:gtk', 667 ], 668 },], 669 ['OS == "linux"', { 670 'link_settings': { 671 'libraries': [ 672 # We need rt for clock_gettime(). 673 '-lrt', 674 # For 'native_library_linux.cc' 675 '-ldl', 676 ], 677 }, 678 }], 679 [ 'OS == "mac" or OS == "win"', { 680 'dependencies': [ 681 '../third_party/nss/nss.gyp:nss', 682 ], 683 },], 684 [ 'OS != "win"', { 685 'dependencies': ['../third_party/libevent/libevent.gyp:libevent'], 686 },], 687 ], 688 }, 689 ], 690 }], 691 [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', { 692 'targets': [ 693 { 694 'target_name': 'symbolize', 695 'type': '<(library)', 696 'variables': { 697 'chromium_code': 0, 698 }, 699 'conditions': [ 700 [ 'OS == "solaris"', { 701 'include_dirs': [ 702 '/usr/gnu/include', 703 '/usr/gnu/include/libelf', 704 ], 705 },], 706 ], 707 'cflags': [ 708 '-Wno-sign-compare', 709 ], 710 'cflags!': [ 711 '-Wextra', 712 ], 713 'sources': [ 714 'third_party/symbolize/symbolize.cc', 715 'third_party/symbolize/demangle.cc', 716 ], 717 }, 718 { 719 'target_name': 'xdg_mime', 720 'type': '<(library)', 721 'variables': { 722 'chromium_code': 0, 723 }, 724 'cflags!': [ 725 '-Wextra', 726 ], 727 'sources': [ 728 'third_party/xdg_mime/xdgmime.c', 729 'third_party/xdg_mime/xdgmime.h', 730 'third_party/xdg_mime/xdgmimealias.c', 731 'third_party/xdg_mime/xdgmimealias.h', 732 'third_party/xdg_mime/xdgmimecache.c', 733 'third_party/xdg_mime/xdgmimecache.h', 734 'third_party/xdg_mime/xdgmimeglob.c', 735 'third_party/xdg_mime/xdgmimeglob.h', 736 'third_party/xdg_mime/xdgmimeicon.c', 737 'third_party/xdg_mime/xdgmimeicon.h', 738 'third_party/xdg_mime/xdgmimeint.c', 739 'third_party/xdg_mime/xdgmimeint.h', 740 'third_party/xdg_mime/xdgmimemagic.c', 741 'third_party/xdg_mime/xdgmimemagic.h', 742 'third_party/xdg_mime/xdgmimeparent.c', 743 'third_party/xdg_mime/xdgmimeparent.h', 744 ], 745 }, 746 ], 747 }], 748 ], 749} 750