0

Moves common apple mobile gn variables into mobile_config.gni.

Bug: 331320406
Change-Id: Ie36973281695a83093b14a26195faf81392f061e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6015178
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1383072}
This commit is contained in:
Rohit Rao
2024-11-14 17:35:16 +00:00
committed by Chromium LUCI CQ
parent 7cafbc2be7
commit 92edf2c502
17 changed files with 119 additions and 98 deletions

@ -14,7 +14,6 @@ import("//build/config/compiler/compiler.gni")
import("//build/config/cronet/config.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/features.gni")
import("//build/config/ios/config.gni")
import("//build/config/rust.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
@ -53,6 +52,10 @@ if (is_fuchsia) {
import("//chrome/browser/buildflags.gni")
}
if (is_ios) {
import("//build/config/apple/mobile_config.gni")
}
if (is_linux) {
import("build/config/linux/gtk/gtk.gni")
}

@ -29,7 +29,6 @@ import("//build/config/chromeos/ui_mode.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/cronet/config.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/ios/config.gni")
import("//build/config/logging.gni")
import("//build/config/nacl/config.gni")
import("//build/config/profiling/profiling.gni")
@ -47,6 +46,9 @@ import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
if (is_ios) {
# Used to access target_environment.
import("//build/config/apple/mobile_config.gni")
# Used to access ios_is_app_extension variable definition.
import("//build/config/ios/ios_sdk.gni")
}

@ -0,0 +1,93 @@
# Copyright 2024 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
# Configure the environment for which to build. Could be either "device",
# "simulator" or "catalyst". If unspecified, then it will be assumed to be
# "simulator" if the target_cpu is "x68" or "x64", "device" otherwise. The
# default is only there for compatibility reasons and will be removed (see
# crbug.com/1138425 for more details).
target_environment = ""
# Control whether codesiging is enabled (ignored for simulator builds).
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_enable_code_signing = true
# Explicitly select the identity to use for codesigning. If defined, must
# be set to a non-empty string that will be passed to codesigning. Can be
# left unspecified if ios_code_signing_identity_description is used instead.
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_code_signing_identity = ""
# Pattern used to select the identity to use for codesigning. If defined,
# must be a substring of the description of exactly one of the identities by
# `security find-identity -v -p codesigning`.
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_code_signing_identity_description = "Apple Development"
# Prefix for CFBundleIdentifier property of iOS bundles (correspond to the
# "Organization Identifier" in Xcode). Code signing will fail if no mobile
# provisioning for the selected code signing identify support that prefix.
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_app_bundle_id_prefix = "org.chromium.ost"
# Paths to the mobileprovision files for the chosen code signing
# identity description and app bundle id prefix.
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_mobileprovision_files = []
}
# As entitlements are tied to a specific bundle identifier, all the
# test applications share the same identifier. This simplifies adding
# new test application (since there is no need to investigate which
# entitlements they need, nor to wait for the mobile provision with
# those entitlements to be generated by Apple and then deployed to the
# infrastructure, ...). The drawback is that only one test application
# can be installed at a time on a device/simulator (as the bundle
# identifier uniquely identify an application).
#
# This variable corresponds to the test bundle identifier.
shared_bundle_id_for_test_apps =
"$ios_app_bundle_id_prefix.chrome.unittests.dev"
# If codesigning is enabled, use must configure either a codesigning identity
# or a filter to automatically select the codesigning identity.
if (target_environment == "device" && ios_enable_code_signing) {
assert(ios_code_signing_identity == "" ||
ios_code_signing_identity_description == "",
"You should either specify the precise identity to use with " +
"ios_code_signing_identity or let the code select an identity " +
"automatically (via find_signing_identity.py which use the " +
"variable ios_code_signing_identity_description to set the " +
"pattern to match the identity to use).")
}
if (target_environment == "device" && ios_enable_code_signing) {
# Automatically select a codesigning identity if no identity is configured.
# This only applies to device build as simulator builds are not signed.
if (ios_code_signing_identity == "") {
find_signing_identity_args = []
if (ios_code_signing_identity_description != "") {
find_signing_identity_args = [
"--matching-pattern",
ios_code_signing_identity_description,
]
}
ios_code_signing_identity =
exec_script("//build/config/apple/find_signing_identity.py",
find_signing_identity_args,
"trim string")
}
}
if (target_environment == "") {
if (current_cpu == "x86" || current_cpu == "x64") {
target_environment = "simulator"
} else {
target_environment = "device"
}
}
assert(target_environment == "simulator" || target_environment == "device" ||
target_environment == "catalyst")

@ -7,7 +7,7 @@ import("//build/config/rust.gni")
import("clang.gni")
if (is_ios) {
import("//build/config/ios/config.gni") # For `target_environment`
import("//build/config/apple/mobile_config.gni") # For `target_environment`
}
# Helper function for adding cflags to use a clang plugin.

@ -25,10 +25,6 @@ if (is_apple) {
import("//build/config/apple/symbols.gni")
}
if (is_ios) {
import("//build/config/ios/config.gni")
}
declare_args() {
# Set to true to use lld, the LLVM linker.
# In late bring-up on macOS (see docs/mac_lld.md).

@ -8,7 +8,10 @@ import("//build/config/chromeos/ui_mode.gni")
import("//build/config/cronet/config.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/features.gni")
import("//build/config/ios/config.gni")
if (is_ios) {
import("//build/config/apple/mobile_config.gni")
}
declare_args() {
# Specify the current PGO phase.

@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/apple/mobile_config.gni")
import("//build/config/ios/config.gni")
import("//build/config/ios/ios_sdk.gni")
import("//build/toolchain/apple/toolchain.gni")
import("//build/toolchain/rbe.gni")

@ -2,28 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
# Configure the environment for which to build. Could be either "device",
# "simulator" or "catalyst". If unspecified, then it will be assumed to be
# "simulator" if the target_cpu is "x68" or "x64", "device" otherwise. The
# default is only there for compatibility reasons and will be removed (see
# crbug.com/1138425 for more details).
target_environment = ""
import("//build/config/apple/mobile_config.gni")
declare_args() {
# Generate orderfile at application startup and then exit.
# NOTE: This flag adds runtime tooling to capture function call details,
# writes out an orderfile to the documents directory, then terminates the
# application. It should generally NOT be enabled.
ios_chrome_generate_order_file = false
}
if (target_environment == "") {
if (current_cpu == "x86" || current_cpu == "x64") {
target_environment = "simulator"
} else {
target_environment = "device"
}
}
assert(target_environment == "simulator" || target_environment == "device" ||
target_environment == "catalyst")

@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/ios/config.gni")
import("//build/config/apple/mobile_config.gni")
import("//build/config/ios/ios_sdk_overrides.gni")
import("//build/toolchain/rbe.gni")
import("//build/toolchain/siso.gni")
@ -30,44 +30,10 @@ declare_args() {
# Set DEVELOPER_DIR while running sdk_info.py.
ios_sdk_developer_dir = ""
# Control whether codesiging is enabled (ignored for simulator builds).
ios_enable_code_signing = true
# Explicitly select the identity to use for codesigning. If defined, must
# be set to a non-empty string that will be passed to codesigning. Can be
# left unspecified if ios_code_signing_identity_description is used instead.
ios_code_signing_identity = ""
# Pattern used to select the identity to use for codesigning. If defined,
# must be a substring of the description of exactly one of the identities by
# `security find-identity -v -p codesigning`.
ios_code_signing_identity_description = "Apple Development"
# Prefix for CFBundleIdentifier property of iOS bundles (correspond to the
# "Organization Identifier" in Xcode). Code signing will fail if no mobile
# provisioning for the selected code signing identify support that prefix.
ios_app_bundle_id_prefix = "org.chromium.ost"
# Paths to the mobileprovision files for the chosen code signing
# identity description and app bundle id prefix.
ios_mobileprovision_files = []
# Set to true if building an app extension.
ios_is_app_extension = false
}
# If codesigning is enabled, use must configure either a codesigning identity
# or a filter to automatically select the codesigning identity.
if (target_environment == "device" && ios_enable_code_signing) {
assert(ios_code_signing_identity == "" ||
ios_code_signing_identity_description == "",
"You should either specify the precise identity to use with " +
"ios_code_signing_identity or let the code select an identity " +
"automatically (via find_signing_identity.py which use the " +
"variable ios_code_signing_identity_description to set the " +
"pattern to match the identity to use).")
}
# Building XCTests requires copying XCTRunner.app which is part of the iOS
# SDK (and shipped inside Xcode.app) into the application. When using the
# system installation of Xcode, those files are outside of the checkout.
@ -151,36 +117,5 @@ if (ios_sdk_path == "") {
}
}
if (target_environment == "device" && ios_enable_code_signing) {
# Automatically select a codesigning identity if no identity is configured.
# This only applies to device build as simulator builds are not signed.
if (ios_code_signing_identity == "") {
find_signing_identity_args = []
if (ios_code_signing_identity_description != "") {
find_signing_identity_args = [
"--matching-pattern",
ios_code_signing_identity_description,
]
}
ios_code_signing_identity =
exec_script("//build/config/apple/find_signing_identity.py",
find_signing_identity_args,
"trim string")
}
}
# As entitlements are tied to a specific bundle identifier, all the
# test application on iOS share the same identifier. This simplify
# adding new test application (since there is no need to investigate
# which entitlements they need, nor to wait for the mobile provision
# with those entitlements to be generated by Apple and then deployed
# to the infrastructure, ...). The drawback is that since only one
# test application can be installed at a time on a device/simulator
# (as the bundle identifier uniquely identify an application for iOS).
#
# This variable corresponds to the test bundle identifier.
shared_bundle_id_for_test_apps =
"$ios_app_bundle_id_prefix.chrome.unittests.dev"
_sdk_root = rebase_path(ios_sdk_path, root_build_dir)
ios_sdk_logs = [ "ios_sdk_path=${_sdk_root}" ]

@ -12,8 +12,7 @@ if (is_android) {
}
if (is_ios) {
import("//build/config/ios/config.gni") # For `target_environment`
import("//build/config/ios/ios_sdk.gni") # For `xcode_version_int`
import("//build/config/apple/mobile_config.gni") # For `target_environment`
}
declare_args() {

@ -11,7 +11,7 @@ import("//build/toolchain/toolchain.gni")
import("//build_overrides/build.gni")
if (is_ios) {
import("//build/config/ios/ios_sdk.gni")
import("//build/config/apple/mobile_config.gni")
}
# libfuzzer can't cope with shared objects being unloaded, which sometimes

@ -8,6 +8,7 @@
build_dotfile_settings = {
exec_script_whitelist = [
"//build/config/android/rules.gni",
"//build/config/apple/mobile_config.gni",
"//build/config/chromeos/rules.gni",
"//build/config/compiler/BUILD.gn",
"//build/config/compiler/pgo/BUILD.gn",

@ -21,7 +21,7 @@ import("//build_overrides/build.gni")
# swift compiler (as it does not include support for catalyst). Remove it
# once the support is available.
if (is_ios) {
import("//build/config/ios/config.gni")
import("//build/config/apple/mobile_config.gni")
import("//build/config/ios/ios_sdk.gni")
}

@ -33,8 +33,8 @@ if (is_android) {
import("//third_party/fuchsia-gn-sdk/src/component.gni")
import("//third_party/fuchsia-gn-sdk/src/package.gni")
} else if (is_ios) {
import("//build/config/apple/mobile_config.gni")
import("//build/config/apple/swift_source_set.gni")
import("//build/config/ios/config.gni")
import("//content/shell/app/ios/extensions.gni")
}

@ -2,9 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/apple/mobile_config.gni")
import("//build/config/apple/symbols.gni")
import("//build/config/chrome_build.gni")
import("//build/config/features.gni")
import("//build/config/ios/config.gni")
import("//build/config/ios/ios_sdk.gni")
# Xcode 13.1 or higher is required to build Chromium on iOS. This file should

@ -5,6 +5,7 @@
import("//build/apple/compile_entitlements.gni")
import("//build/apple/tweak_info_plist.gni")
import("//build/buildflag_header.gni")
import("//build/config/apple/mobile_config.gni")
import("//build/config/ios/config.gni")
import("//build/config/ios/ios_sdk.gni")
import("//build/config/ios/rules.gni")

@ -4,7 +4,7 @@
import("//build/apple/compile_entitlements.gni")
import("//build/apple/tweak_info_plist.gni")
import("//build/config/ios/ios_sdk.gni")
import("//build/config/apple/mobile_config.gni")
import("//build/config/ios/rules.gni")
import("//build/ios/extension_bundle_data.gni")
import("//ios/build/chrome_build.gni")