From 9f4429f87c8aa2f1c57c25e1eec3e51385c14e49 Mon Sep 17 00:00:00 2001 From: Andrew Spiering Date: Sun, 17 Sep 2023 22:26:50 -0700 Subject: [PATCH 1/2] When building the engine if you don't have iOS SDK Installed then don't build it Currently when you try and build macOS editor it assumes you also want to build iOS because of the way this check works which assumes if you have Xcode Installed you are ready to go. This really should not be the case, so instead lets check to see if you have the iophonesdk installed for your current Xcode if not then skip it. --- .../Flax.Build/Platforms/iOS/iOSPlatform.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs b/Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs index 2d7a3372a..379616e5a 100644 --- a/Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs +++ b/Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs @@ -1,5 +1,8 @@ // Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. +using System; +using System.IO; + namespace Flax.Build.Platforms { /// @@ -11,6 +14,9 @@ namespace Flax.Build.Platforms /// public override TargetPlatform Target => TargetPlatform.iOS; + /// + public override bool HasRequiredSDKsInstalled { get; } + /// public override bool HasDynamicCodeExecutionSupport => false; @@ -21,11 +27,19 @@ namespace Flax.Build.Platforms { if (Platform.BuildTargetPlatform != TargetPlatform.Mac) return; - if (!HasRequiredSDKsInstalled) + + if (!XCode.Instance.IsValid) { Log.Warning("Missing XCode. Cannot build for iOS platform."); return; } + + // We should check and see if the actual iphoneSDK is installed + string iphoneSDKPath = Utilities.ReadProcessOutput("/usr/bin/xcrun", "--sdk iphoneos --show-sdk-path"); + if (string.IsNullOrEmpty(iphoneSDKPath) || !Directory.Exists(iphoneSDKPath)) { + Log.Warning("Missing iPhoneSDK. Cannot build for iOS platform."); + HasRequiredSDKsInstalled = false; + } } /// From 97f595922eef0199ae06f0157c3eb4ae9e0fd817 Mon Sep 17 00:00:00 2001 From: Andrew Spiering Date: Sun, 17 Sep 2023 23:11:23 -0700 Subject: [PATCH 2/2] Fixing broken build Have to actually set it to true --- Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs b/Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs index 379616e5a..49c3ec406 100644 --- a/Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs +++ b/Source/Tools/Flax.Build/Platforms/iOS/iOSPlatform.cs @@ -40,6 +40,8 @@ namespace Flax.Build.Platforms Log.Warning("Missing iPhoneSDK. Cannot build for iOS platform."); HasRequiredSDKsInstalled = false; } + else + HasRequiredSDKsInstalled = true; } ///