Skip to content

Commit 77b49a7

Browse files
committed
Revert "APPLE: Extract TBB Patches"
This reverts commit 451712c.
1 parent b9f223f commit 77b49a7

2 files changed

Lines changed: 21 additions & 49 deletions

File tree

build_scripts/apple_utils.py

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -120,29 +120,19 @@ def SupportsMacOSUniversalBinaries():
120120
XcodeVersion = XcodeOutput[XcodeFind:].split(' ')[1]
121121
return (XcodeVersion > '11.0')
122122

123-
124-
def GetSDKName(context) -> str:
123+
def GetSDKRoot(context) -> Optional[str]:
125124
sdk = "macosx"
126125
if context.buildTarget == TARGET_IOS:
127-
sdk = "iPhoneOS"
126+
sdk = "iphoneos"
128127
elif context.buildTarget == TARGET_VISIONOS:
129-
sdk = "xrOS"
130-
131-
return sdk
132-
133-
def GetSDKRoot(context) -> Optional[str]:
134-
sdk = GetSDKName(context).lower()
128+
sdk = "xros"
135129

136130
for arg in (context.cmakeBuildArgs or '').split():
137131
if "CMAKE_OSX_SYSROOT" in arg:
138132
override = arg.split('=')[1].strip('"').strip()
139133
if override:
140134
sdk = override
141-
142-
sdkroot = GetCommandOutput(["xcrun", "--sdk", sdk, "--show-sdk-path"])
143-
if not sdkroot:
144-
raise RuntimeError(f"Could not find an sdk path. Make sure you have the {sdk} sdk installed.")
145-
return sdkroot
135+
return GetCommandOutput(["xcrun", "--sdk", sdk, "--show-sdk-path"])
146136

147137
def SetTarget(context, targetName):
148138
context.targetNative = (targetName == TARGET_NATIVE)
@@ -260,30 +250,3 @@ def ConfigureCMakeExtraArgs(context, args:List[str]) -> List[str]:
260250
args.append(f"-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH")
261251

262252
return args
263-
264-
def GetTBBPatches(context):
265-
if context.buildTarget not in EMBEDDED_PLATFORMS or context.buildTarget == TARGET_IOS:
266-
# TBB already handles these so we don't patch them out
267-
return [], []
268-
269-
sdk_name = GetSDKName(context)
270-
271-
# Standard Target based names
272-
target_config_patches = [("ios", context.buildTarget.lower()),
273-
("iOS", context.buildTarget),
274-
("IPHONEOS", sdk_name.upper())]
275-
276-
clang_config_patches = [("ios",context.buildTarget.lower()),
277-
("iOS", context.buildTarget),
278-
("IPHONEOS",sdk_name.upper())]
279-
280-
if context.buildTarget == TARGET_VISIONOS:
281-
target_config_patches.extend([("iPhone", "XR"),
282-
("?= 8.0", "?= 1.0")])
283-
284-
clang_config_patches.append(("iPhone", "XR"),)
285-
286-
if context.buildTarget == TARGET_VISIONOS:
287-
clang_config_patches.append(("-miphoneos-version-min=", "-target arm64-apple-xros"))
288-
289-
return target_config_patches, clang_config_patches

build_scripts/build_usd.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,21 +1061,30 @@ def InstallTBB_MacOS(context, force, buildArgs):
10611061
"ifeq ($(arch),$(filter $(arch),armv7 armv7s {0}))"
10621062
.format(apple_utils.GetTargetArmArch()))])
10631063

1064-
if MacOSTargetEmbedded(context) and context.buildTarget != apple_utils.TARGET_IOS:
1065-
target_config_patches, clang_config_patches = apple_utils.GetTBBPatches(context)
1066-
# Create config from iOS config
1064+
if context.buildTarget == apple_utils.TARGET_VISIONOS:
1065+
# Create visionOS config from iOS config
10671066
shutil.copy(
10681067
src="build/ios.macos.inc",
1069-
dst=f"build/{context.buildTarget.lower()}.macos.inc")
1068+
dst="build/visionos.macos.inc")
10701069

1071-
PatchFile(f"build/{context.buildTarget.lower()}.macos.inc", target_config_patches)
1070+
PatchFile("build/visionos.macos.inc",
1071+
[("ios","visionos"),
1072+
("iOS", "visionOS"),
1073+
("iPhone", "XR"),
1074+
("IPHONEOS","XROS"),
1075+
("?= 8.0", "?= 1.0")])
10721076

10731077
# iOS clang just reuses the macOS one,
10741078
# so it's easier to copy it directly.
10751079
shutil.copy(src="build/macos.clang.inc",
1076-
dst=f"build/{context.buildTarget.lower()}.clang.inc")
1077-
1078-
PatchFile(f"build/{context.buildTarget.lower()}.clang.inc",clang_config_patches)
1080+
dst="build/visionos.clang.inc")
1081+
1082+
PatchFile("build/visionos.clang.inc",
1083+
[("ios","visionos"),
1084+
("-miphoneos-version-min=", "-target arm64-apple-xros"),
1085+
("iOS", "visionOS"),
1086+
("iPhone", "XR"),
1087+
("IPHONEOS","XROS")])
10791088

10801089
(primaryArch, secondaryArch) = apple_utils.GetTargetArchPair(context)
10811090

0 commit comments

Comments
 (0)