Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -984,31 +984,19 @@ hooks = [
'terminal.x64,terminal.qemu-arm64',
]
},
# The following two scripts check if they are running in the LUCI
# environment, and do nothing if so. This is because Xcode is not yet
# installed in CI when these hooks are run.
# The following script checks if it is running in the LUCI environment,
# and does nothing if so. This is because Xcode is not yet installed in CI
# when this hook is run.
{
'name': 'Find the iOS device SDKs',
'name': 'Find the iOS and macOS SDKs',
'pattern': '.',
'condition': 'host_os == "mac"',
'action': [
'python3',
'engine/src/build/config/ios/ios_sdk.py',
# This cleans up entries under flutter/prebuilts for this script and the
# following script.
'engine/src/build/mac/apple_sdk.py',
'--as-gclient-hook'
]
},
{
'name': 'Find the macOS SDK',
'pattern': '.',
'condition': 'host_os == "mac"',
'action': [
'python3',
'engine/src/build/mac/find_sdk.py',
'--as-gclient-hook',
]
},
{
'name': 'Generate Fuchsia GN build rules',
'pattern': '.',
Expand Down
2 changes: 1 addition & 1 deletion engine/src/build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ if (custom_toolchain != "") {
host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
set_default_toolchain("//build/toolchain/mac:clang_$current_cpu")
} else if (is_ios) {
import("//build/config/ios/ios_sdk.gni") # For use_ios_simulator
import("//build/config/apple/apple_sdk.gni") # For use_ios_simulator
host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
if (use_ios_simulator) {
if (target_cpu == "arm64") {
Expand Down
168 changes: 160 additions & 8 deletions engine/src/build/config/apple/apple_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,168 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/toolchain/rbe.gni")

assert(host_os == "mac")

# Common args across all Apple platforms.
declare_args() {
# Path to the Xcode toolchain (XcodeDefault.xctoolchain).
apple_host_toolchain_path = ""
# The MACOSX_DEPLOYMENT_TARGET variable used when compiling.
# Must be of the form x.x.x for Info.plist files.
mac_deployment_target = ""

# Path to the host Xcode toolchain (XcodeDefault.xctoolchain).
mac_host_toolchain_path = ""

# Path to the macOS platform.
mac_platform_path = ""

# Path to a specific version of the macOS SDK, not including a backslash at
# the end.
mac_sdk_path = ""
}

# Must be set above or by gn.
assert(mac_deployment_target != "")

if (is_ios) {
# iOS-specific args.
declare_args() {
# Path to the iOS platform to use.
#
# When empty, this will use the default platform based on the value of
# use_ios_simulator.
ios_platform_path = ""

# Path to the iOS SDK to use.
#
# When empty this will use the default SDK based on the value of
# use_ios_simulator.
ios_sdk_path = ""

# Set to true when targeting a simulator build on iOS. False means that the
# target is for running on the device. The default value is to use the
# Simulator except when targeting GYP's Xcode builds (for compat with the
# existing GYP build).
use_ios_simulator = true

# Alias for use_ios_simulator used by Skia.
ios_use_simulator = true

# Version of iOS that we're targeting.
ios_deployment_target = "13.0"

# The path to the iOS device platform.
ios_device_platform_path = ""

# The path to the iOS simulator platform.
ios_simulator_platform_path = ""

# The path to the iOS device SDK.
ios_device_sdk_path = ""

# The path to the iOS simulator SDK.
ios_simulator_sdk_path = ""

# The path to iOS SDK Swift libraries.
ios_swift_lib_paths = []

# Version of iOS that we're targeting for tests.
ios_testing_deployment_target = "13.0"
}

# Must be set above or by gn.
assert(defined(use_ios_simulator))
assert(defined(ios_use_simulator))
assert(ios_deployment_target != "")
assert(ios_testing_deployment_target != "")
}

# Run apple_sdk.gni to determine SDK paths if necessary.
_need_apple_sdk_run = false
if (mac_host_toolchain_path == "" || #
mac_sdk_path == "" || #
mac_platform_path == "") {
_need_apple_sdk_run = true
}
if (is_ios) {
if (use_ios_simulator &&
(ios_simulator_platform_path == "" || ios_simulator_sdk_path == "")) {
_need_apple_sdk_run = true
}
if (!use_ios_simulator &&
(ios_device_platform_path == "" || ios_device_sdk_path == "")) {
_need_apple_sdk_run = true
}
}
if (_need_apple_sdk_run) {
_args = [ "--print-paths" ]
if (use_rbe && create_xcode_symlinks) {
# RBE has a restriction that paths cannot come from outside the build root.
_args += [
"--symlink",
rebase_path("//flutter/prebuilts"),
]
}
_sdk_result =
exec_script(rebase_path("//build/mac/apple_sdk.py"), _args, "scope")
}

if (apple_host_toolchain_path == "") {
# Outputs the SDK path on the first line, and the host toolchain path on the
# second.
_find_sdk_lines =
exec_script("//build/mac/find_sdk.py", ["--print_sdk_path", "1.0"], "list lines")
# Set SDK paths.
if (mac_host_toolchain_path == "") {
mac_host_toolchain_path = _sdk_result.toolchain_path
}
assert(mac_host_toolchain_path != "")

if (mac_sdk_path == "") {
mac_sdk_path = _sdk_result.macosx_sdk_path
}
assert(mac_sdk_path != "")

if (mac_platform_path == "") {
mac_platform_path = _sdk_result.macosx_platform_path
}
assert(mac_platform_path != "")

if (is_ios) {
if (ios_platform_path == "" || ios_sdk_path == "") {
if (use_ios_simulator) {
if (ios_simulator_platform_path == "") {
ios_simulator_platform_path = _sdk_result.iphonesimulator_platform_path
}
if (ios_simulator_sdk_path == "") {
ios_simulator_sdk_path = _sdk_result.iphonesimulator_sdk_path
}
} else {
if (ios_device_platform_path == "") {
ios_device_platform_path = _sdk_result.iphoneos_platform_path
}
if (ios_device_sdk_path == "") {
ios_device_sdk_path = _sdk_result.iphoneos_sdk_path
}
}

if (use_ios_simulator) {
assert(ios_simulator_platform_path != "")
assert(ios_simulator_sdk_path != "")
ios_platform_path = ios_simulator_platform_path
ios_sdk_path = ios_simulator_sdk_path
} else {
assert(ios_device_platform_path != "")
assert(ios_device_sdk_path != "")
ios_platform_path = ios_device_platform_path
ios_sdk_path = ios_device_sdk_path
}
}

apple_host_toolchain_path = _find_sdk_lines[1]
if (ios_swift_lib_paths == []) {
ios_swift_lib_paths += [ rebase_path("$ios_sdk_path/usr/lib/swift") ]
if (use_ios_simulator) {
ios_swift_lib_paths += [ rebase_path(
"$mac_host_toolchain_path/usr/lib/swift/iphonesimulator") ]
} else {
ios_swift_lib_paths +=
[ rebase_path("$mac_host_toolchain_path/usr/lib/swift/iphoneos") ]
}
}
}
2 changes: 1 addition & 1 deletion engine/src/build/config/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ config("compiler") {
_swift_version = "5"

# TODO(cbracken): https://github.com/flutter/flutter/issues/167592
# Look up xcode_version in ios_sdk.gni/mac_sdk.gni.
# Look up xcode_version in apple_sdk.gni
#
# This is here so that all files get recompiled after an Xcode update.
# (defines are passed via the command line, and build system rebuild things
Expand Down
84 changes: 0 additions & 84 deletions engine/src/build/config/ios/ios_sdk.gni

This file was deleted.

Loading