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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
422 } | 423 } |
423 | 424 |
424 if (is_android) { | 425 if (is_android) { |
425 group("content_shell") { | 426 group("content_shell") { |
426 testonly = true | 427 testonly = true |
427 deps = [ | 428 deps = [ |
428 "//content/shell/android:content_shell_apk", | 429 "//content/shell/android:content_shell_apk", |
429 ] | 430 ] |
430 } | 431 } |
431 } else if (is_mac) { | 432 } else if (is_mac) { |
432 group("content_shell") { | 433 mac_app_bundle("content_shell") { |
433 testonly = true | 434 testonly = true |
435 output_name = content_shell_product_name | |
436 sources = [ | |
437 "app/shell_main.cc", | |
438 ] | |
434 deps = [ | 439 deps = [ |
435 ":content_shell_lib", | 440 ":content_shell_framework_bundle_data", |
441 ":content_shell_resources_bundle_data", | |
442 | |
443 # TODO(rsesek): Remove this after GYP is gone, since it only needs to | |
444 # be here per the comment in blink_test_platform_support_mac.mm about | |
445 # the bundle structure. | |
446 "//components/test_runner:resources", | |
436 ] | 447 ] |
448 info_plist = "app/app-Info.plist" | |
437 } | 449 } |
438 } else { | 450 } else { |
439 # TODO(brettw) when GYP is no longer necessary, delete | 451 # TODO(brettw) when GYP is no longer necessary, delete |
440 # content/shell/app/shell.exe.manifest. This file is not used in GN. | 452 # content/shell/app/shell.exe.manifest. This file is not used in GN. |
441 executable("content_shell") { | 453 executable("content_shell") { |
442 testonly = true | 454 testonly = true |
443 | 455 |
444 # TODO(GYP) mac resource bundle stuff for this target. | 456 # TODO(GYP) mac resource bundle stuff for this target. |
445 # TODO(GYP) Windows content shell settings: | 457 # TODO(GYP) Windows content shell settings: |
446 # - RC file. | 458 # - RC file. |
(...skipping 15 matching lines...) Expand all Loading... | |
462 deps += [ "//sandbox" ] | 474 deps += [ "//sandbox" ] |
463 if (win_console_app) { | 475 if (win_console_app) { |
464 defines += [ "WIN_CONSOLE_APP" ] | 476 defines += [ "WIN_CONSOLE_APP" ] |
465 } else { | 477 } else { |
466 # Set /SUBSYSTEM:WINDOWS unless a console build has been requested. | 478 # Set /SUBSYSTEM:WINDOWS unless a console build has been requested. |
467 configs -= [ "//build/config/win:console" ] | 479 configs -= [ "//build/config/win:console" ] |
468 configs += [ "//build/config/win:windowed" ] | 480 configs += [ "//build/config/win:windowed" ] |
469 } | 481 } |
470 } | 482 } |
471 | 483 |
472 if (is_mac) { | |
473 # TODO(GYP) lots of stuff from GYP file here including helper_app and | |
474 # postbuilds. | |
475 output_name = content_shell_product_name | |
476 deps = [ | |
477 ":framework", | |
478 ] | |
479 } | |
480 | |
481 if (is_linux && !is_component_build) { | 484 if (is_linux && !is_component_build) { |
482 # Set rpath to find our own libfreetype even in a non-component build. | 485 # Set rpath to find our own libfreetype even in a non-component build. |
483 configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] | 486 configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] |
484 } | 487 } |
485 } | 488 } |
486 } | 489 } |
487 | 490 |
488 if (is_win) { | 491 if (is_win) { |
489 # GYP version: content/content_shell_and_tests.gyp:content_shell_crash_service | 492 # GYP version: content/content_shell_and_tests.gyp:content_shell_crash_service |
490 executable("content_shell_crash_service") { | 493 executable("content_shell_crash_service") { |
491 sources = [ | 494 sources = [ |
492 "tools/content_shell_crash_service.cc", | 495 "tools/content_shell_crash_service.cc", |
493 ] | 496 ] |
494 | 497 |
495 deps = [ | 498 deps = [ |
496 "//base", | 499 "//base", |
497 "//build/config/sanitizers:deps", | 500 "//build/config/sanitizers:deps", |
498 "//components/crash/content/tools:crash_service", | 501 "//components/crash/content/tools:crash_service", |
499 ] | 502 ] |
500 | 503 |
501 configs -= [ "//build/config/win:console" ] | 504 configs -= [ "//build/config/win:console" ] |
502 configs += [ "//build/config/win:windowed" ] | 505 configs += [ "//build/config/win:windowed" ] |
503 } | 506 } |
504 } | 507 } |
505 | 508 |
506 if (is_mac) { | 509 if (is_mac) { |
507 # TODO(GYP) this should be a bundle. Lots of other stuff in this target. | 510 mac_xib_bundle_data("content_shell_framework_xibs") { |
508 # GYP version: content/content_shell.gypi:content_shell_framework | 511 sources = [ |
509 shared_library("framework") { | 512 "app/English.lproj/HttpAuth.xib", |
513 "app/English.lproj/MainMenu.xib", | |
514 ] | |
515 output_path = "{{bundle_resources_dir}}/English.lproj" | |
516 } | |
517 | |
518 bundle_data("content_shell_framework_resources") { | |
519 sources = [ | |
520 "$root_out_dir/content_shell.pak", | |
521 "$root_out_dir/icudtl.dat", | |
522 "resources/missingImage.png", | |
523 "resources/textAreaResizeCorner.png", | |
524 ] | |
525 | |
526 public_deps = [ | |
527 ":pak", | |
528 ] | |
529 | |
530 deps = [ | |
531 "//third_party/icu:icudata", | |
532 ] | |
533 | |
534 if (v8_use_external_startup_data) { | |
535 sources += [ | |
536 "$root_out_dir/natives_blob.bin", | |
537 "$root_out_dir/snapshot_blob.bin", | |
538 ] | |
539 public_deps += [ "//v8" ] | |
540 } | |
541 | |
542 outputs = [ | |
543 "{{bundle_resources_dir}}/{{source_file_part}}", | |
544 ] | |
545 } | |
546 | |
547 if (enable_plugins) { | |
548 bundle_data("content_shell_framework_plugins") { | |
549 sources = [ | |
550 "$root_out_dir/blink_deprecated_test_plugin.plugin", | |
551 "$root_out_dir/blink_test_plugin.plugin", | |
552 ] | |
553 | |
554 outputs = [ | |
555 "{{bundle_root_dir}}/{{source_file_part}}", | |
556 ] | |
557 | |
558 public_deps = [ | |
559 "//ppapi:blink_deprecated_test_plugin", | |
560 "//ppapi:blink_test_plugin", | |
561 ] | |
562 } | |
563 } | |
564 | |
565 content_shell_framework_name = "$content_shell_product_name Framework" | |
566 content_shell_helper_name = "$content_shell_product_name Helper" | |
567 | |
568 mac_framework_bundle("content_shell_framework") { | |
510 testonly = true | 569 testonly = true |
511 | 570 |
512 # TODO(GYP) bug 546894: Fix GN and toolchains to handle spaces here. | 571 output_name = content_shell_framework_name |
513 #output_name = "$content_shell_product_name Framework" | |
514 output_name = "content_shell_framework" # Temporary one with no spaces. | |
515 | 572 |
516 sources = [ | 573 sources = [ |
517 "app/shell_content_main.cc", | 574 "app/shell_content_main.cc", |
518 "app/shell_content_main.h", | 575 "app/shell_content_main.h", |
519 ] | 576 ] |
520 | 577 |
578 # TODO(rsesek): Handle these missing pieces: | |
579 # - crash_inspector | |
580 # - crash_report_sender.app | |
581 | |
521 deps = [ | 582 deps = [ |
583 ":content_shell_framework_resources", | |
584 ":content_shell_framework_xibs", | |
522 ":content_shell_lib", | 585 ":content_shell_lib", |
586 "//third_party/icu:icudata", | |
523 ] | 587 ] |
588 | |
589 if (enable_plugins) { | |
590 deps += [ ":content_shell_framework_plugins" ] | |
591 } | |
592 | |
593 ldflags = [ | |
594 "-install_name", | |
595 "@executable_path/../Frameworks/$output_name.framework/$output_name", | |
596 ] | |
597 | |
598 info_plist = "app/framework-Info.plist" | |
524 } | 599 } |
525 | 600 |
526 mac_app_bundle("content_shell_helper_app") { | 601 mac_app_bundle("content_shell_helper_app") { |
527 testonly = true | 602 testonly = true |
528 output_name = "$content_shell_product_name Helper" | 603 output_name = content_shell_helper_name |
529 sources = [ | 604 sources = [ |
530 "app/shell_main.cc", | 605 "app/shell_main.cc", |
531 ] | 606 ] |
532 deps = [ | 607 deps = [ |
533 ":framework", | 608 ":content_shell_framework+link", |
534 ] | 609 ] |
535 info_plist = "app/helper-Info.plist" | 610 info_plist = "app/helper-Info.plist" |
536 } | 611 } |
612 | |
613 action("fix_helper_link_framework") { | |
brettw
2016/04/28 20:27:48
Can you give an overview here as a comment about h
Robert Sesek
2016/04/28 21:17:45
Done.
| |
614 testonly = true | |
615 script = "//build/config/mac/xcrun.py" | |
616 inputs = [ | |
617 "$root_out_dir/$content_shell_helper_name.app/Contents/MacOS/$content_shel l_helper_name", | |
618 ] | |
619 | |
620 stamp_file = "$target_out_dir/xcrun_$target_name.stamp" | |
621 outputs = [ | |
622 stamp_file, | |
623 ] | |
624 | |
625 # TODO(rsesek): Figure out something like GYP's postbuilds to allow | |
626 # install_name_tool to operate in-place <https://crbug.com/607292>. | |
627 args = [ | |
628 "--stamp", | |
629 rebase_path(stamp_file, root_build_dir), | |
630 | |
631 # xcrun arguments: | |
632 "install_name_tool", | |
633 "-change", | |
634 "@executable_path/../Frameworks/$content_shell_framework_name.frame work/$content_shell_framework_name", | |
635 "@executable_path/../../../$content_shell_framework_name.framework/ $content_shell_framework_name", | |
636 ] + rebase_path(inputs, root_build_dir) | |
637 public_deps = [ | |
638 ":content_shell_helper_app", | |
639 ] | |
640 } | |
641 | |
642 bundle_data("content_shell_framework_bundle_data") { | |
643 testonly = true | |
644 sources = [ | |
645 "$root_out_dir/$content_shell_framework_name.framework", | |
646 "$root_out_dir/$content_shell_helper_name.app", | |
647 ] | |
648 outputs = [ | |
649 "{{bundle_root_dir}}/Frameworks/{{source_file_part}}", | |
650 ] | |
651 public_deps = [ | |
652 ":content_shell_framework+link", | |
653 ":fix_helper_link_framework", | |
654 ] | |
655 } | |
656 | |
657 bundle_data("content_shell_resources_bundle_data") { | |
658 testonly = true | |
659 sources = [ | |
660 "app/app.icns", | |
661 ] | |
662 outputs = [ | |
663 "{{bundle_resources_dir}}/{{source_file_part}}", | |
664 ] | |
665 } | |
537 } | 666 } |
538 | 667 |
539 mojom("mojo_bindings") { | 668 mojom("mojo_bindings") { |
540 sources = [ | 669 sources = [ |
541 "common/layout_test/layout_test_bluetooth_fake_adapter_setter.mojom", | 670 "common/layout_test/layout_test_bluetooth_fake_adapter_setter.mojom", |
542 ] | 671 ] |
543 } | 672 } |
OLD | NEW |