Skip to content

Commit

Permalink
-- fixed appletv and catalyst
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavriloaie Eugen-Andrei committed Jan 14, 2021
1 parent 74231eb commit c504d28
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
15 changes: 13 additions & 2 deletions config/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ config("compiler") {
}

# Environment.
if (ios_device_name == "macosx") {
target_environment = "catalyst"
}
if (target_environment == "simulator") {
triplet_environment = "-simulator"
} else if (target_environment == "device") {
Expand All @@ -55,7 +58,15 @@ config("compiler") {
}

# OS.
triplet_os = "apple-ios"
triplet_os = ""
if ((ios_device_name == "iphone") || (ios_device_name == "macosx")) {
triplet_os = "apple-ios"
} else if (ios_device_name == "appletv") {
triplet_os = "apple-tvos"
} else {
assert(false, "unsupported device: $ios_device_name")
}


# Set target.
common_flags = [
Expand Down Expand Up @@ -107,7 +118,7 @@ config("runtime_library") {
_sdk_root,
]

if (target_environment == "catalyst") {
if ((target_environment == "catalyst") || (ios_device_name == "macosx")) {
common_flags += [
"-isystem",
"$_sdk_root/System/iOSSupport/usr/include",
Expand Down
4 changes: 3 additions & 1 deletion config/ios/codesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ def Load(self):

@staticmethod
def Kind(platform, extension):
if platform == 'iphonesimulator' or platform == 'iphoneos':
if platform == 'iphonesimulator' or platform == 'iphoneos' or platform == 'macosx':
return 'ios'
if platform == 'appletvsimulator' or platform == 'appletvos':
return 'tvos'
if platform == 'macosx':
if extension == '.framework':
return 'mac_framework'
Expand Down
19 changes: 10 additions & 9 deletions config/ios/ios_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ if(ios_device_name != "macosx" ) {

if (ios_sdk_path == "") {
# Compute default target.
if (target_environment == "simulator") {
ios_sdk_name = "iphonesimulator"
ios_sdk_platform = "iPhoneSimulator"
} else if (target_environment == "device") {
ios_sdk_name = "iphoneos"
ios_sdk_platform = "iPhoneOS"
} else if (target_environment == "catalyst") {
if(ios_device_name != "macosx" ) {
if (use_ios_simulator) {
ios_sdk_name = ios_device_name + "simulator"
ios_sdk_platform = ios_device_name + "Simulator"
} else {
ios_sdk_name = ios_device_name + "os"
ios_sdk_platform = ios_device_name + "OS"
}
} else {
ios_sdk_name = "macosx"
ios_sdk_platform = "MacOSX"
} else {
assert(false, "unsupported environment: $target_environment")
}

ios_sdk_info_args = [
Expand All @@ -158,6 +158,7 @@ if (ios_sdk_path == "") {
}
script_name = "//build/config/mac/sdk_info.py"
_ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")
ios_sdk_platform_abs_path = _ios_sdk_result.sdk_platform_path
ios_sdk_path = _ios_sdk_result.sdk_path
ios_sdk_platform_path = _ios_sdk_result.sdk_platform_path
ios_sdk_version = _ios_sdk_result.sdk_version
Expand Down

0 comments on commit c504d28

Please sign in to comment.