New: Add Android build support on macOS
Enable Android SDK/NDK discovery on macOS, use the darwin-x86_64 NDK toolchain, and support the modern NDK include layout used by NDK r27.
This commit is contained in:
@@ -14,6 +14,7 @@ namespace FlaxEditor.Content.Settings
|
||||
internal const string PS5PlatformSettingsTypename = "FlaxEditor.Content.Settings.PS5PlatformSettings";
|
||||
internal const string XboxOnePlatformSettingsTypename = "FlaxEditor.Content.Settings.XboxOnePlatformSettings";
|
||||
internal const string XboxScarlettPlatformSettingsTypename = "FlaxEditor.Content.Settings.XboxScarlettPlatformSettings";
|
||||
internal const string AndroidPlatformSettingsTypename = "FlaxEditor.Content.Settings.AndroidPlatformSettings";
|
||||
internal const string SwitchPlatformSettingsTypename = "FlaxEditor.Content.Settings.SwitchPlatformSettings";
|
||||
#if FLAX_EDITOR
|
||||
internal static string[] OptionalPlatformSettings =
|
||||
@@ -172,9 +173,9 @@ namespace FlaxEditor.Content.Settings
|
||||
|
||||
#if FLAX_EDITOR || PLATFORM_ANDROID
|
||||
/// <summary>
|
||||
/// Reference to <see cref="AndroidPlatformSettings"/> asset. Used to apply configuration on Android platform.
|
||||
/// Reference to Android Platform Settings asset. Used to apply configuration on Android platform.
|
||||
/// </summary>
|
||||
[EditorOrder(2060), EditorDisplay("Platform Settings", "Android"), AssetReference(typeof(AndroidPlatformSettings), true), Tooltip("Reference to Android Platform Settings asset")]
|
||||
[EditorOrder(2060), EditorDisplay("Platform Settings", "Android"), AssetReference(AndroidPlatformSettingsTypename, true), Tooltip("Reference to Android Platform Settings asset")]
|
||||
public JsonAsset AndroidPlatform;
|
||||
#endif
|
||||
|
||||
@@ -334,8 +335,8 @@ namespace FlaxEditor.Content.Settings
|
||||
return Load(gameSettings.XboxScarlettPlatform, XboxScarlettPlatformSettingsTypename) as T;
|
||||
#endif
|
||||
#if FLAX_EDITOR || PLATFORM_ANDROID
|
||||
if (type == typeof(AndroidPlatformSettings))
|
||||
return Load<AndroidPlatformSettings>(gameSettings.AndroidPlatform) as T;
|
||||
if (type.FullName == AndroidPlatformSettingsTypename)
|
||||
return Load(gameSettings.AndroidPlatform, AndroidPlatformSettingsTypename) as T;
|
||||
#endif
|
||||
#if FLAX_EDITOR || PLATFORM_SWITCH
|
||||
if (type.FullName == SwitchPlatformSettingsTypename)
|
||||
@@ -436,7 +437,7 @@ namespace FlaxEditor.Content.Settings
|
||||
return gameSettings.XboxScarlettPlatform;
|
||||
#endif
|
||||
#if FLAX_EDITOR || PLATFORM_ANDROID
|
||||
if (type == typeof(AndroidPlatformSettings))
|
||||
if (type.FullName == AndroidPlatformSettingsTypename)
|
||||
return gameSettings.AndroidPlatform;
|
||||
#endif
|
||||
#if FLAX_EDITOR || PLATFORM_SWITCH
|
||||
|
||||
@@ -963,7 +963,7 @@ void AndroidPlatform::Tick()
|
||||
// Pool app events
|
||||
int events;
|
||||
android_poll_source* source;
|
||||
while (ALooper_pollAll(0, nullptr, &events, reinterpret_cast<void**>(&source)) >= 0)
|
||||
while (ALooper_pollOnce(0, nullptr, &events, reinterpret_cast<void**>(&source)) >= 0)
|
||||
{
|
||||
// Process event
|
||||
if (source != nullptr)
|
||||
|
||||
@@ -471,6 +471,13 @@ int32 MacPlatform::CreateProcess(CreateProcessSettings& settings)
|
||||
task.arguments = AppleUtils::ParseArguments(AppleUtils::ToNSString(settings.Arguments));
|
||||
if (settings.WorkingDirectory.HasChars())
|
||||
task.currentDirectoryPath = AppleUtils::ToNSString(settings.WorkingDirectory);
|
||||
[task setStandardInput:[NSFileHandle fileHandleWithNullDevice]];
|
||||
if (!captureStdOut)
|
||||
{
|
||||
NSFileHandle* nullDevice = [NSFileHandle fileHandleWithNullDevice];
|
||||
[task setStandardOutput:nullDevice];
|
||||
[task setStandardError:nullDevice];
|
||||
}
|
||||
|
||||
int32 returnCode = 0;
|
||||
if (settings.WaitForEnd)
|
||||
|
||||
Reference in New Issue
Block a user