Commit f022bb98 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

Package WebKit alongside apps when building with checkout_ios_webkit.

BUG=934252

Change-Id: Ic704622e78833816458d8b06d310eda8583fff59
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827864
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701201}
parent 206dc832
...@@ -5,19 +5,30 @@ ...@@ -5,19 +5,30 @@
import("//build/config/gclient_args.gni") import("//build/config/gclient_args.gni")
import("//build/config/ios/ios_sdk.gni") import("//build/config/ios/ios_sdk.gni")
# Using a locally-built WebKit is only supported for Debug simulator builds.
_build_custom_webkit = checkout_ios_webkit && is_debug && use_ios_simulator
group("webkit") { group("webkit") {
if (checkout_ios_webkit) { if (_build_custom_webkit) {
deps = [ deps = [
":compile_webkit", ":bundle_webkit_frameworks",
] ]
} }
all_dependent_configs = [ ":_webkit_config" ] all_dependent_configs = [ ":_webkit_config" ]
} }
if (checkout_ios_webkit) { if (_build_custom_webkit) {
# WebKit is built from source using xcodebuild (invoked via the
# build_webkit.py wrapper script). The WebKit build places its frameworks in
# a sub-directory named "Debug-iphonesimulator".
_webkit_xcodebuild_out_dir = "Debug-iphonesimulator"
action("compile_webkit") { action("compile_webkit") {
visibility = [ ":webkit" ] visibility = [
":bundle_webkit_frameworks",
":webkit",
]
script = "build_webkit.py" script = "build_webkit.py"
...@@ -41,13 +52,18 @@ if (checkout_ios_webkit) { ...@@ -41,13 +52,18 @@ if (checkout_ios_webkit) {
"src/WebKitLibraries/ChangeLog", "src/WebKitLibraries/ChangeLog",
] ]
_framework_out_dir = "$target_out_dir/$_webkit_xcodebuild_out_dir"
outputs = [ outputs = [
# The frameworks themselves include many resource files, but as a first # The frameworks themselves include many resource files, but as a first
# step, use just the binaries. # step, use just the binaries.
"$target_out_dir/Debug-iphonesimulator/JavaScriptCore.framework/JavaScriptCore", "$_framework_out_dir/JavaScriptCore.framework",
"$target_out_dir/Debug-iphonesimulator/WebCore.framework/WebCore", "$_framework_out_dir/JavaScriptCore.framework/JavaScriptCore",
"$target_out_dir/Debug-iphonesimulator/WebKit.framework/WebKit", "$_framework_out_dir/WebCore.framework",
"$target_out_dir/Debug-iphonesimulator/WebKitLegacy.framework/WebKitLegacy", "$_framework_out_dir/WebCore.framework/WebCore",
"$_framework_out_dir/WebKit.framework",
"$_framework_out_dir/WebKit.framework/WebKit",
"$_framework_out_dir/WebKitLegacy.framework",
"$_framework_out_dir/WebKitLegacy.framework/WebKitLegacy",
] ]
# TODO(crbug.com/934252): "-j 4" restricts xcodebuild to four simultaneous # TODO(crbug.com/934252): "-j 4" restricts xcodebuild to four simultaneous
...@@ -63,16 +79,34 @@ if (checkout_ios_webkit) { ...@@ -63,16 +79,34 @@ if (checkout_ios_webkit) {
"-quiet", "-quiet",
] ]
} }
bundle_data("bundle_webkit_frameworks") {
public_deps = [
":compile_webkit",
]
_framework_out_dir = "$target_out_dir/$_webkit_xcodebuild_out_dir"
sources = [
"$_framework_out_dir/JavaScriptCore.framework",
"$_framework_out_dir/WebCore.framework",
"$_framework_out_dir/WebKit.framework",
"$_framework_out_dir/WebKitLegacy.framework",
]
outputs = [
"{{bundle_contents_dir}}/WebKitFrameworks/{{source_file_part}}",
]
}
} }
config("_webkit_config") { config("_webkit_config") {
if (checkout_ios_webkit) { if (_build_custom_webkit) {
# From the ld documentation: "Directories specified with -F are searched in # From the ld documentation: "Directories specified with -F are searched in
# the order they appear on the command line and before the default search # the order they appear on the command line and before the default search
# path." # path."
_framework_out_dir = "$target_out_dir/$_webkit_xcodebuild_out_dir"
common_flags = [ common_flags = [
"-F", "-F",
rebase_path("$target_out_dir/Debug-iphonesimulator/", root_build_dir), rebase_path("$_framework_out_dir/", root_build_dir),
] ]
cflags = common_flags cflags = common_flags
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment