Chromium Code Reviews| Index: content/shell/BUILD.gn |
| diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn |
| index 8e59d0d52dd06e41b59c86bb53e856b569a7e918..6a6ecd8381de2df84faee433669c3cdc3d95e248 100644 |
| --- a/content/shell/BUILD.gn |
| +++ b/content/shell/BUILD.gn |
| @@ -15,6 +15,7 @@ if (is_android) { |
| import("//build/config/android/config.gni") |
| } else if (is_mac) { |
| import("//build/config/mac/rules.gni") |
| + import("//build_overrides/v8.gni") |
| } |
| declare_args() { |
| @@ -429,11 +430,22 @@ if (is_android) { |
| ] |
| } |
| } else if (is_mac) { |
| - group("content_shell") { |
| + mac_app_bundle("content_shell") { |
| testonly = true |
| + output_name = content_shell_product_name |
| + sources = [ |
| + "app/shell_main.cc", |
| + ] |
| deps = [ |
| - ":content_shell_lib", |
| + ":content_shell_framework_bundle_data", |
| + ":content_shell_resources_bundle_data", |
| + |
| + # TODO(rsesek): Remove this after GYP is gone, since it only needs to |
| + # be here per the comment in blink_test_platform_support_mac.mm about |
| + # the bundle structure. |
| + "//components/test_runner:resources", |
| ] |
| + info_plist = "app/app-Info.plist" |
| } |
| } else { |
| # TODO(brettw) when GYP is no longer necessary, delete |
| @@ -469,15 +481,6 @@ if (is_android) { |
| } |
| } |
| - if (is_mac) { |
| - # TODO(GYP) lots of stuff from GYP file here including helper_app and |
| - # postbuilds. |
| - output_name = content_shell_product_name |
| - deps = [ |
| - ":framework", |
| - ] |
| - } |
| - |
| if (is_linux && !is_component_build) { |
| # Set rpath to find our own libfreetype even in a non-component build. |
| configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] |
| @@ -504,36 +507,155 @@ if (is_win) { |
| } |
| if (is_mac) { |
| - # TODO(GYP) this should be a bundle. Lots of other stuff in this target. |
| - # GYP version: content/content_shell.gypi:content_shell_framework |
| - shared_library("framework") { |
| + mac_xib_bundle_data("content_shell_framework_xibs") { |
| + sources = [ |
| + "app/English.lproj/HttpAuth.xib", |
| + "app/English.lproj/MainMenu.xib", |
| + ] |
| + output_path = "{{bundle_resources_dir}}/English.lproj" |
| + } |
| + |
| + bundle_data("content_shell_framework_resources") { |
| + sources = [ |
| + "$root_out_dir/content_shell.pak", |
| + "$root_out_dir/icudtl.dat", |
| + "resources/missingImage.png", |
| + "resources/textAreaResizeCorner.png", |
| + ] |
| + |
| + public_deps = [ |
| + ":pak", |
| + ] |
| + |
| + deps = [ |
| + "//third_party/icu:icudata", |
| + ] |
| + |
| + if (v8_use_external_startup_data) { |
| + sources += [ |
| + "$root_out_dir/natives_blob.bin", |
| + "$root_out_dir/snapshot_blob.bin", |
| + ] |
| + public_deps += [ "//v8" ] |
| + } |
| + |
| + outputs = [ |
| + "{{bundle_resources_dir}}/{{source_file_part}}", |
| + ] |
| + } |
| + |
| + if (enable_plugins) { |
| + bundle_data("content_shell_framework_plugins") { |
| + sources = [ |
| + "$root_out_dir/blink_deprecated_test_plugin.plugin", |
| + "$root_out_dir/blink_test_plugin.plugin", |
| + ] |
| + |
| + outputs = [ |
| + "{{bundle_root_dir}}/{{source_file_part}}", |
| + ] |
| + |
| + public_deps = [ |
| + "//ppapi:blink_deprecated_test_plugin", |
| + "//ppapi:blink_test_plugin", |
| + ] |
| + } |
| + } |
| + |
| + declare_args() { |
| + content_shell_framework_name = "$content_shell_product_name Framework" |
| + content_shell_helper_name = "$content_shell_product_name Helper" |
| + } |
|
Dirk Pranke
2016/04/25 21:29:19
You only need declare_args() for things that will
Robert Sesek
2016/04/25 21:44:08
Done.
|
| + |
| + mac_framework_bundle("content_shell_framework") { |
| testonly = true |
| - # TODO(GYP) bug 546894: Fix GN and toolchains to handle spaces here. |
| - #output_name = "$content_shell_product_name Framework" |
| - output_name = "content_shell_framework" # Temporary one with no spaces. |
| + output_name = content_shell_framework_name |
| sources = [ |
| "app/shell_content_main.cc", |
| "app/shell_content_main.h", |
| ] |
| + # TODO(rsesek): Handle these missing pieces: |
| + # - crash_inspector |
| + # - crash_report_sender.app |
| + |
| deps = [ |
| + ":content_shell_framework_resources", |
| + ":content_shell_framework_xibs", |
| ":content_shell_lib", |
| + "//third_party/icu:icudata", |
| ] |
| + |
| + if (enable_plugins) { |
| + deps += [ ":content_shell_framework_plugins" ] |
| + } |
| + |
| + ldflags = [ |
| + "-install_name", |
| + "@executable_path/../Frameworks/$output_name.framework/$output_name", |
| + ] |
| + |
| + info_plist = "app/framework-Info.plist" |
| } |
| mac_app_bundle("content_shell_helper_app") { |
| testonly = true |
| - output_name = "$content_shell_product_name Helper" |
| + output_name = content_shell_helper_name |
| sources = [ |
| "app/shell_main.cc", |
| ] |
| deps = [ |
| - ":framework", |
| + ":content_shell_framework+link", |
|
Dirk Pranke
2016/04/25 21:29:19
This is a target generated by the mac_framework_bu
Robert Sesek
2016/04/25 21:44:08
Yup.
|
| ] |
| info_plist = "app/helper-Info.plist" |
| } |
| + |
| + action("fix_helper_link_framework") { |
| + testonly = true |
| + script = "//build/config/mac/xcrun.py" |
| + inputs = [ |
| + "$root_out_dir/$content_shell_helper_name.app/Contents/MacOS/$content_shell_helper_name", |
| + ] |
| + outputs = [ |
| + "$root_out_dir/$content_shell_helper_name.app/Contents/MacOS/.", |
|
Dirk Pranke
2016/04/25 21:29:19
Do you need the trailing "." here so GN doesn't ye
Robert Sesek
2016/04/25 21:44:08
Oh I forgot to call this out explicitly as weird.
|
| + ] |
| + args = [ |
| + "install_name_tool", |
| + "-change", |
| + "@executable_path/../Frameworks/$content_shell_framework_name.framework/$content_shell_framework_name", |
| + "@executable_path/../../../$content_shell_framework_name.framework/$content_shell_framework_name", |
| + ] + rebase_path(inputs, root_build_dir) |
| + public_deps = [ |
| + ":content_shell_helper_app", |
| + ] |
| + } |
| + |
| + bundle_data("content_shell_framework_bundle_data") { |
| + testonly = true |
| + sources = [ |
| + "$root_out_dir/$content_shell_framework_name.framework", |
| + "$root_out_dir/$content_shell_helper_name.app", |
| + ] |
| + outputs = [ |
| + "{{bundle_root_dir}}/Frameworks/{{source_file_part}}", |
| + ] |
| + public_deps = [ |
| + ":content_shell_framework+link", |
| + ":fix_helper_link_framework", |
| + ] |
| + } |
| + |
| + bundle_data("content_shell_resources_bundle_data") { |
| + testonly = true |
| + sources = [ |
| + "app/app.icns", |
| + ] |
| + outputs = [ |
| + "{{bundle_resources_dir}}/{{source_file_part}}", |
| + ] |
| + } |
| } |
| mojom("mojo_bindings") { |