Skip to content

Commit 86780b7

Browse files
hiroshihoriepblazej
authored andcommitted
tv & watch support
1 parent 843494a commit 86780b7

File tree

6 files changed

+63
-42
lines changed

6 files changed

+63
-42
lines changed

config/apple/codesign.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ def Kind(platform, extension):
106106
return 'xros'
107107
if platform == 'xrsimulator':
108108
return 'xrsimulator'
109+
if platform == 'appletvos':
110+
return 'appletvos'
111+
if platform == 'appletvsimulator':
112+
return 'appletvsimulator'
113+
if platform == 'watchos':
114+
return 'watchos'
115+
if platform == 'watchsimulator':
116+
return 'watchsimulator'
109117
if platform == 'macosx':
110118
if extension == '.framework':
111119
return 'mac_framework'

config/apple/sdk_info.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,8 @@ def main():
133133
default='.',
134134
help='Value of gn $root_build_dir')
135135
parser.add_argument('platform',
136-
choices=[
137-
'appletvos',
138-
'appletvsimulator',
139-
'iphoneos',
140-
'iphonesimulator',
141-
'macosx',
142-
'watchos',
143-
'watchsimulator',
144-
'xros',
145-
'xrsimulator'
146-
])
136+
choices=['iphoneos', 'iphonesimulator', 'macosx', 'xros', 'xrsimulator', 'appletvos',
137+
'appletvsimulator', 'watchos', 'watchsimulator'])
147138
args = parser.parse_args()
148139
if args.developer_dir:
149140
os.environ['DEVELOPER_DIR'] = args.developer_dir

config/ios/BUILD.gn

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ config("compiler") {
4141
triplet_environment = ""
4242
} else if (target_environment == "xrsimulator") {
4343
triplet_environment = "-simulator"
44+
} else if (target_environment == "appletv") {
45+
triplet_environment = ""
46+
} else if (target_environment == "appletvsimulator") {
47+
triplet_environment = "-simulator"
48+
} else if (target_environment == "watch") {
49+
triplet_environment = ""
50+
} else if (target_environment == "watchsimulator") {
51+
triplet_environment = "-simulator"
4452
} else if (target_environment == "catalyst") {
4553
triplet_environment = "-macabi"
4654
} else {
@@ -56,6 +64,10 @@ config("compiler") {
5664

5765
if (target_environment == "xrdevice" || target_environment == "xrsimulator") {
5866
triplet_os = "apple-xros"
67+
} else if (target_environment == "appletv" || target_environment == "appletvsimulator") {
68+
triplet_os = "apple-tvos"
69+
} else if (target_environment == "watch" || target_environment == "watchsimulator") {
70+
triplet_os = "apple-watchos"
5971
}
6072

6173
# Set target.
@@ -208,6 +220,14 @@ config("ios_dynamic_flags") {
208220
_swift_compatibility_libs_suffix = "xros"
209221
} else if (target_environment == "xrsimulator") {
210222
_swift_compatibility_libs_suffix = "xrsimulator"
223+
} else if (target_environment == "appletv") {
224+
_swift_compatibility_libs_suffix = "appletvos"
225+
} else if (target_environment == "appletvsimulator") {
226+
_swift_compatibility_libs_suffix = "appletvsimulator"
227+
} else if (target_environment == "watch") {
228+
_swift_compatibility_libs_suffix = "watchos"
229+
} else if (target_environment == "watchsimulator") {
230+
_swift_compatibility_libs_suffix = "watchsimulator"
211231
} else if (target_environment == "catalyst") {
212232
# The Swift compatibility libraries have changed location starting with
213233
# Xcode 13.0, so check the version of Xcode when deciding which path to

config/ios/config.gni

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ if (target_environment == "") {
2121
}
2222

2323
assert(target_environment == "simulator" || target_environment == "device" ||
24-
target_environment == "catalyst" || target_environment == "xrdevice" || target_environment == "xrsimulator")
24+
target_environment == "catalyst" || target_environment == "xrdevice" || target_environment == "xrsimulator" ||
25+
target_environment == "appletv" ||target_environment == "appletvsimulator" ||
26+
target_environment == "watch" ||target_environment == "watchsimulator")

config/ios/ios_sdk.gni

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -63,35 +63,33 @@ ios_use_xcode_symlinks =
6363

6464
if (ios_sdk_path == "") {
6565
# Compute default target.
66-
if (target_platform == "iphoneos") {
67-
if (target_environment == "simulator") {
68-
ios_sdk_name = "iphonesimulator"
69-
ios_sdk_platform = "iPhoneSimulator"
70-
} else if (target_environment == "device") {
71-
ios_sdk_name = "iphoneos"
72-
ios_sdk_platform = "iPhoneOS"
73-
} else if (target_environment == "xrdevice") {
74-
ios_sdk_name = "xros"
75-
ios_sdk_platform = "XROS"
76-
} else if (target_environment == "xrsimulator") {
77-
ios_sdk_name = "xrsimulator"
78-
ios_sdk_platform = "XRSimulator"
79-
} else if (target_environment == "catalyst") {
80-
ios_sdk_name = "macosx"
81-
ios_sdk_platform = "MacOSX"
82-
} else {
83-
assert(false, "unsupported target_environment=$target_environment")
84-
}
85-
} else if (target_platform == "tvos") {
86-
if (target_environment == "simulator") {
87-
ios_sdk_name = "appletvsimulator"
88-
ios_sdk_platform = "AppleTVSimulator"
89-
} else if (target_environment == "device") {
90-
ios_sdk_name = "appletvos"
91-
ios_sdk_platform = "AppleTVOS"
92-
} else {
93-
assert(false, "unsupported target_environment=$target_environment")
94-
}
66+
if (target_environment == "simulator") {
67+
ios_sdk_name = "iphonesimulator"
68+
ios_sdk_platform = "iPhoneSimulator"
69+
} else if (target_environment == "device") {
70+
ios_sdk_name = "iphoneos"
71+
ios_sdk_platform = "iPhoneOS"
72+
} else if (target_environment == "xrdevice") {
73+
ios_sdk_name = "xros"
74+
ios_sdk_platform = "XROS"
75+
} else if (target_environment == "xrsimulator") {
76+
ios_sdk_name = "xrsimulator"
77+
ios_sdk_platform = "XRSimulator"
78+
} else if (target_environment == "watch") {
79+
ios_sdk_name = "watchos"
80+
ios_sdk_platform = "WatchOS"
81+
} else if (target_environment == "watchsimulator") {
82+
ios_sdk_name = "watchsimulator"
83+
ios_sdk_platform = "WatchSimulator"
84+
} else if (target_environment == "appletv") {
85+
ios_sdk_name = "appletvos"
86+
ios_sdk_platform = "AppleTVOS"
87+
} else if (target_environment == "appletvsimulator") {
88+
ios_sdk_name = "appletvsimulator"
89+
ios_sdk_platform = "AppleTVSimulator"
90+
} else if (target_environment == "catalyst") {
91+
ios_sdk_name = "macosx"
92+
ios_sdk_platform = "MacOSX"
9593
} else {
9694
assert(false, "unsupported target_platform=$target_platform")
9795
}

config/ios/rules.gni

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,9 @@ template("ios_framework_bundle") {
830830
_public_headers = invoker.public_headers
831831

832832
_framework_root_dir = "$root_out_dir/$_output_name.framework"
833-
if (target_environment == "simulator" || target_environment == "device" || target_environment == "xrdevice" || target_environment == "xrsimulator") {
833+
if (target_environment == "simulator" || target_environment == "device" || target_environment == "xrdevice" ||
834+
target_environment == "xrsimulator" || target_environment == "appletv" || target_environment == "appletvsimulator" ||
835+
target_environment == "watch" || target_environment == "watchsimulator") {
834836
_framework_contents_dir = _framework_root_dir
835837
} else if (target_environment == "catalyst") {
836838
_framework_contents_dir = "$_framework_root_dir/Versions/A"

0 commit comments

Comments
 (0)