OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
7 import("//build/config/ui.gni") | 7 import("//build/config/ui.gni") |
8 import("//build/config/win/console_app.gni") | 8 import("//build/config/win/console_app.gni") |
9 import("//build/config/win/manifest.gni") | 9 import("//build/config/win/manifest.gni") |
10 import("//media/media_options.gni") | 10 import("//media/media_options.gni") |
11 import("//mojo/public/tools/bindings/mojom.gni") | 11 import("//mojo/public/tools/bindings/mojom.gni") |
12 import("//tools/grit/repack.gni") | 12 import("//tools/grit/repack.gni") |
13 import("//tools/grit/grit_rule.gni") | 13 import("//tools/grit/grit_rule.gni") |
14 if (is_android) { | 14 if (is_android) { |
15 import("//build/config/android/config.gni") | 15 import("//build/config/android/config.gni") |
16 } else if (is_mac) { | 16 } else if (is_mac) { |
17 import("//build/config/mac/rules.gni") | 17 import("//build/config/mac/rules.gni") |
| 18 import("//build_overrides/v8.gni") |
18 } | 19 } |
19 | 20 |
20 declare_args() { | 21 declare_args() { |
21 content_shell_product_name = "Content Shell" | 22 content_shell_product_name = "Content Shell" |
22 content_shell_version = "99.77.34.5" | 23 content_shell_version = "99.77.34.5" |
23 } | 24 } |
24 | 25 |
25 config("content_shell_lib_warnings") { | 26 config("content_shell_lib_warnings") { |
26 if (is_clang) { | 27 if (is_clang) { |
27 # TODO(thakis): Remove this once http://crbug.com/383820 is figured out | 28 # TODO(thakis): Remove this once http://crbug.com/383820 is figured out |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 } | 424 } |
424 | 425 |
425 if (is_android) { | 426 if (is_android) { |
426 group("content_shell") { | 427 group("content_shell") { |
427 testonly = true | 428 testonly = true |
428 deps = [ | 429 deps = [ |
429 "//content/shell/android:content_shell_apk", | 430 "//content/shell/android:content_shell_apk", |
430 ] | 431 ] |
431 } | 432 } |
432 } else if (is_mac) { | 433 } else if (is_mac) { |
433 group("content_shell") { | 434 mac_app_bundle("content_shell") { |
434 testonly = true | 435 testonly = true |
| 436 output_name = content_shell_product_name |
| 437 sources = [ |
| 438 "app/shell_main.cc", |
| 439 ] |
435 deps = [ | 440 deps = [ |
436 ":content_shell_lib", | 441 ":content_shell_framework_bundle_data", |
| 442 ":content_shell_resources_bundle_data", |
| 443 |
| 444 # TODO(rsesek): Remove this after GYP is gone, since it only needs to |
| 445 # be here per the comment in blink_test_platform_support_mac.mm about |
| 446 # the bundle structure. |
| 447 "//components/test_runner:resources", |
437 ] | 448 ] |
| 449 info_plist = "app/app-Info.plist" |
438 } | 450 } |
439 } else { | 451 } else { |
440 # TODO(brettw) when GYP is no longer necessary, delete | 452 # TODO(brettw) when GYP is no longer necessary, delete |
441 # content/shell/app/shell.exe.manifest. This file is not used in GN. | 453 # content/shell/app/shell.exe.manifest. This file is not used in GN. |
442 executable("content_shell") { | 454 executable("content_shell") { |
443 testonly = true | 455 testonly = true |
444 | 456 |
445 # TODO(GYP) mac resource bundle stuff for this target. | 457 # TODO(GYP) mac resource bundle stuff for this target. |
446 # TODO(GYP) Windows content shell settings: | 458 # TODO(GYP) Windows content shell settings: |
447 # - RC file. | 459 # - RC file. |
(...skipping 15 matching lines...) Expand all Loading... |
463 deps += [ "//sandbox" ] | 475 deps += [ "//sandbox" ] |
464 if (win_console_app) { | 476 if (win_console_app) { |
465 defines += [ "WIN_CONSOLE_APP" ] | 477 defines += [ "WIN_CONSOLE_APP" ] |
466 } else { | 478 } else { |
467 # Set /SUBSYSTEM:WINDOWS unless a console build has been requested. | 479 # Set /SUBSYSTEM:WINDOWS unless a console build has been requested. |
468 configs -= [ "//build/config/win:console" ] | 480 configs -= [ "//build/config/win:console" ] |
469 configs += [ "//build/config/win:windowed" ] | 481 configs += [ "//build/config/win:windowed" ] |
470 } | 482 } |
471 } | 483 } |
472 | 484 |
473 if (is_mac) { | |
474 # TODO(GYP) lots of stuff from GYP file here including helper_app and | |
475 # postbuilds. | |
476 output_name = content_shell_product_name | |
477 deps = [ | |
478 ":framework", | |
479 ] | |
480 } | |
481 | |
482 if (is_linux && !is_component_build) { | 485 if (is_linux && !is_component_build) { |
483 # Set rpath to find our own libfreetype even in a non-component build. | 486 # Set rpath to find our own libfreetype even in a non-component build. |
484 configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] | 487 configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] |
485 } | 488 } |
486 } | 489 } |
487 } | 490 } |
488 | 491 |
489 if (is_win) { | 492 if (is_win) { |
490 # GYP version: content/content_shell_and_tests.gyp:content_shell_crash_service | 493 # GYP version: content/content_shell_and_tests.gyp:content_shell_crash_service |
491 executable("content_shell_crash_service") { | 494 executable("content_shell_crash_service") { |
492 sources = [ | 495 sources = [ |
493 "tools/content_shell_crash_service.cc", | 496 "tools/content_shell_crash_service.cc", |
494 ] | 497 ] |
495 | 498 |
496 deps = [ | 499 deps = [ |
497 "//base", | 500 "//base", |
498 "//build/config/sanitizers:deps", | 501 "//build/config/sanitizers:deps", |
499 "//build/win:default_exe_manifest", | 502 "//build/win:default_exe_manifest", |
500 "//components/crash/content/tools:crash_service", | 503 "//components/crash/content/tools:crash_service", |
501 ] | 504 ] |
502 | 505 |
503 configs -= [ "//build/config/win:console" ] | 506 configs -= [ "//build/config/win:console" ] |
504 configs += [ "//build/config/win:windowed" ] | 507 configs += [ "//build/config/win:windowed" ] |
505 } | 508 } |
506 } | 509 } |
507 | 510 |
508 if (is_mac) { | 511 if (is_mac) { |
509 # TODO(GYP) this should be a bundle. Lots of other stuff in this target. | 512 mac_xib_bundle_data("content_shell_framework_xibs") { |
510 # GYP version: content/content_shell.gypi:content_shell_framework | 513 sources = [ |
511 shared_library("framework") { | 514 "app/English.lproj/HttpAuth.xib", |
| 515 "app/English.lproj/MainMenu.xib", |
| 516 ] |
| 517 output_path = "{{bundle_resources_dir}}/English.lproj" |
| 518 } |
| 519 |
| 520 bundle_data("content_shell_framework_resources") { |
| 521 sources = [ |
| 522 "$root_out_dir/content_shell.pak", |
| 523 "$root_out_dir/icudtl.dat", |
| 524 "resources/missingImage.png", |
| 525 "resources/textAreaResizeCorner.png", |
| 526 ] |
| 527 |
| 528 public_deps = [ |
| 529 ":pak", |
| 530 ] |
| 531 |
| 532 deps = [ |
| 533 "//third_party/icu:icudata", |
| 534 ] |
| 535 |
| 536 if (v8_use_external_startup_data) { |
| 537 sources += [ |
| 538 "$root_out_dir/natives_blob.bin", |
| 539 "$root_out_dir/snapshot_blob.bin", |
| 540 ] |
| 541 public_deps += [ "//v8" ] |
| 542 } |
| 543 |
| 544 outputs = [ |
| 545 "{{bundle_resources_dir}}/{{source_file_part}}", |
| 546 ] |
| 547 } |
| 548 |
| 549 if (enable_plugins) { |
| 550 bundle_data("content_shell_framework_plugins") { |
| 551 sources = [ |
| 552 "$root_out_dir/blink_deprecated_test_plugin.plugin", |
| 553 "$root_out_dir/blink_test_plugin.plugin", |
| 554 ] |
| 555 |
| 556 outputs = [ |
| 557 "{{bundle_root_dir}}/{{source_file_part}}", |
| 558 ] |
| 559 |
| 560 public_deps = [ |
| 561 "//ppapi:blink_deprecated_test_plugin", |
| 562 "//ppapi:blink_test_plugin", |
| 563 ] |
| 564 } |
| 565 } |
| 566 |
| 567 content_shell_framework_name = "$content_shell_product_name Framework" |
| 568 content_shell_helper_name = "$content_shell_product_name Helper" |
| 569 |
| 570 mac_framework_bundle("content_shell_framework") { |
512 testonly = true | 571 testonly = true |
513 | 572 |
514 # TODO(GYP) bug 546894: Fix GN and toolchains to handle spaces here. | 573 output_name = content_shell_framework_name |
515 #output_name = "$content_shell_product_name Framework" | |
516 output_name = "content_shell_framework" # Temporary one with no spaces. | |
517 | 574 |
518 sources = [ | 575 sources = [ |
519 "app/shell_content_main.cc", | 576 "app/shell_content_main.cc", |
520 "app/shell_content_main.h", | 577 "app/shell_content_main.h", |
521 ] | 578 ] |
522 | 579 |
| 580 # TODO(rsesek): Handle these missing pieces: |
| 581 # - crash_inspector |
| 582 # - crash_report_sender.app |
| 583 |
523 deps = [ | 584 deps = [ |
| 585 ":content_shell_framework_resources", |
| 586 ":content_shell_framework_xibs", |
524 ":content_shell_lib", | 587 ":content_shell_lib", |
| 588 "//third_party/icu:icudata", |
525 ] | 589 ] |
| 590 |
| 591 if (enable_plugins) { |
| 592 deps += [ ":content_shell_framework_plugins" ] |
| 593 } |
| 594 |
| 595 ldflags = [ |
| 596 "-install_name", |
| 597 "@executable_path/../Frameworks/$output_name.framework/$output_name", |
| 598 ] |
| 599 |
| 600 info_plist = "app/framework-Info.plist" |
526 } | 601 } |
527 | 602 |
528 mac_app_bundle("content_shell_helper_app") { | 603 mac_app_bundle("content_shell_helper_app") { |
529 testonly = true | 604 testonly = true |
530 output_name = "$content_shell_product_name Helper" | 605 output_name = content_shell_helper_name |
531 sources = [ | 606 sources = [ |
532 "app/shell_main.cc", | 607 "app/shell_main.cc", |
533 ] | 608 ] |
534 deps = [ | 609 deps = [ |
535 ":framework", | 610 ":content_shell_framework+link", |
536 ] | 611 ] |
537 info_plist = "app/helper-Info.plist" | 612 info_plist = "app/helper-Info.plist" |
538 } | 613 } |
| 614 |
| 615 # The install_name_tool can only operate in-place, rather than producing a |
| 616 # unique output. Use the xcrun wrapper script to write a fake stamp output |
| 617 # file. After :content_shell_helper_app has been built and bundled, this |
| 618 # will run, modifying the executable in the bundle and writing out the |
| 619 # --stamp specified. This will change the mtime on the executable, but |
| 620 # because the stamp will also be updated, the |
| 621 # :content_shell_framework_bundle_data will re-copy the output. This only |
| 622 # works because nothing else depends on the output of |
| 623 # :content_shell_helper_app. |
| 624 # TODO(rsesek): After GYP is gone, re-write content_shell_main to be like |
| 625 # chrome_main and use dlopen() instead of a linked framework. |
| 626 action("fix_helper_link_framework") { |
| 627 testonly = true |
| 628 script = "//build/config/mac/xcrun.py" |
| 629 inputs = [ |
| 630 "$root_out_dir/$content_shell_helper_name.app/Contents/MacOS/$content_shel
l_helper_name", |
| 631 ] |
| 632 |
| 633 stamp_file = "$target_out_dir/xcrun_$target_name.stamp" |
| 634 outputs = [ |
| 635 stamp_file, |
| 636 ] |
| 637 |
| 638 # TODO(rsesek): Figure out something like GYP's postbuilds to allow |
| 639 # install_name_tool to operate in-place <https://crbug.com/607292>. |
| 640 args = [ |
| 641 "--stamp", |
| 642 rebase_path(stamp_file, root_build_dir), |
| 643 |
| 644 # xcrun arguments: |
| 645 "install_name_tool", |
| 646 "-change", |
| 647 "@executable_path/../Frameworks/$content_shell_framework_name.frame
work/$content_shell_framework_name", |
| 648 "@executable_path/../../../$content_shell_framework_name.framework/
$content_shell_framework_name", |
| 649 ] + rebase_path(inputs, root_build_dir) |
| 650 public_deps = [ |
| 651 ":content_shell_helper_app", |
| 652 ] |
| 653 } |
| 654 |
| 655 bundle_data("content_shell_framework_bundle_data") { |
| 656 testonly = true |
| 657 sources = [ |
| 658 "$root_out_dir/$content_shell_framework_name.framework", |
| 659 "$root_out_dir/$content_shell_helper_name.app", |
| 660 ] |
| 661 outputs = [ |
| 662 "{{bundle_root_dir}}/Frameworks/{{source_file_part}}", |
| 663 ] |
| 664 public_deps = [ |
| 665 ":content_shell_framework+link", |
| 666 ":fix_helper_link_framework", |
| 667 ] |
| 668 } |
| 669 |
| 670 bundle_data("content_shell_resources_bundle_data") { |
| 671 testonly = true |
| 672 sources = [ |
| 673 "app/app.icns", |
| 674 ] |
| 675 outputs = [ |
| 676 "{{bundle_resources_dir}}/{{source_file_part}}", |
| 677 ] |
| 678 } |
539 } | 679 } |
540 | 680 |
541 mojom("mojo_bindings") { | 681 mojom("mojo_bindings") { |
542 sources = [ | 682 sources = [ |
543 "common/layout_test/layout_test_bluetooth_fake_adapter_setter.mojom", | 683 "common/layout_test/layout_test_bluetooth_fake_adapter_setter.mojom", |
544 ] | 684 ] |
545 } | 685 } |
OLD | NEW |