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.
52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
|
|
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace Flax.Build.Platforms
|
|
{
|
|
/// <summary>
|
|
/// The build platform for all iOS systems.
|
|
/// </summary>
|
|
/// <seealso cref="UnixPlatform" />
|
|
public sealed class iOSPlatform : ApplePlatform
|
|
{
|
|
/// <inheritdoc />
|
|
public override TargetPlatform Target => TargetPlatform.iOS;
|
|
|
|
/// <inheritdoc />
|
|
public override bool HasRequiredSDKsInstalled { get; }
|
|
|
|
/// <inheritdoc />
|
|
public override bool HasDynamicCodeExecutionSupport => false;
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="Flax.Build.Platforms.iOSPlatform"/> class.
|
|
/// </summary>
|
|
public iOSPlatform()
|
|
{
|
|
if (Platform.BuildTargetPlatform != TargetPlatform.Mac)
|
|
return;
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override Toolchain CreateToolchain(TargetArchitecture architecture)
|
|
{
|
|
return new iOSToolchain(this, architecture);
|
|
}
|
|
}
|
|
}
|