// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System.IO;
namespace Flax.Build.Platforms
{
///
/// The build platform for all iOS systems.
///
///
public sealed class iOSPlatform : ApplePlatform
{
///
public override TargetPlatform Target => TargetPlatform.iOS;
///
public override bool HasRequiredSDKsInstalled { get; }
///
public override bool HasDynamicCodeExecutionSupport => false;
///
/// Initializes a new instance of the class.
///
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;
}
else
HasRequiredSDKsInstalled = true;
}
///
protected override Toolchain CreateToolchain(TargetArchitecture architecture)
{
return new iOSToolchain(this, architecture);
}
}
}