Commit 996107a4 authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Fix mismatch between framework bundle name and umbrella header name

This fixes issue where the generated .modulemap file is referencing a
nonexistent header file.

Change-Id: I156ccff21b5a8cd56b56e4777c2dd601957c5eb3
Bug: 1084855
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209569
Commit-Queue: John Wu <jzw@chromium.org>
Reviewed-by: default avatarHiroshi Ichikawa <ichikawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770936}
parent d05f9592
......@@ -327,8 +327,32 @@ source_set("web_view_sources") {
]
}
# Generate the umbrella header.
action("web_view_umbrella_header") {
# Two umbrella headers may be generated:
# - One that matches ios_web_view_output_name, e.g. CronetChromeWebView.h
# - Another that is hardcoded as ChromeWebView.h
#
# This is needed to fix the issue where the generated .modulemap points to a
# non-existent umbrella header.
#
# TODO(crbug.com/1084855): Remove :web_view_umbrella_header_old after all
# clients migrate off of it.
if (ios_web_view_generate_extra_umbrella_header) {
action("web_view_umbrella_header") {
script = "//build/config/ios/generate_umbrella_header.py"
full_header_path = target_gen_dir + "/" + ios_web_view_output_name + ".h"
outputs = [ full_header_path ]
args = [
"--output-path",
rebase_path(full_header_path, root_build_dir),
]
args += rebase_path(ios_web_view_public_headers, root_build_dir)
}
}
action("web_view_umbrella_header_old") {
script = "//build/config/ios/generate_umbrella_header.py"
full_header_path = target_gen_dir + "/ChromeWebView.h"
......@@ -346,8 +370,11 @@ ios_framework_bundle("web_view") {
output_name = ios_web_view_output_name
info_plist = "Info.plist"
public_headers = ios_web_view_public_headers
public_headers += get_target_outputs(":web_view_umbrella_header")
public_headers = get_target_outputs(":web_view_umbrella_header_old")
if (ios_web_view_generate_extra_umbrella_header) {
public_headers += get_target_outputs(":web_view_umbrella_header")
}
public_headers += ios_web_view_public_headers
if (ios_web_view_include_cronet) {
public_headers += [ "//components/cronet/ios/Cronet.h" ]
public_headers += grpc_public_headers
......@@ -362,10 +389,13 @@ ios_framework_bundle("web_view") {
deps = [
":web_view_sources",
":web_view_umbrella_header",
"//ios/web/public/init",
"//testing/gtest:ios_coverage_utils",
]
deps += [ ":web_view_umbrella_header_old" ]
if (ios_web_view_generate_extra_umbrella_header) {
deps += [ ":web_view_umbrella_header" ]
}
if (ios_web_view_include_cronet) {
deps += [ "//components/cronet/ios:cronet_sources" ]
}
......
......@@ -9,3 +9,14 @@ declare_args() {
# Controls the output name of the built framework.
ios_web_view_output_name = "ChromeWebView"
}
declare_args() {
# If ios_web_view_output_name is overriden, e.g. to CronetChromeWebView, we
# need to generate an extra umbrella header to match the output name of the
# framework bundle.
#
# TODO(crbug.com/1084855): Remove this after all clients migrate to the
# umbrella header that matches the framework.
ios_web_view_generate_extra_umbrella_header =
ios_web_view_output_name != "ChromeWebView"
}
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