Add **Web platform with Emscripten**

This commit is contained in:
Wojtek Figat
2026-02-14 00:07:21 +01:00
parent fd0584b406
commit f12ad5c874
80 changed files with 1529 additions and 61 deletions

View File

@@ -35,6 +35,7 @@ namespace Flax.Build
case TargetPlatform.Switch:
case TargetPlatform.Mac:
case TargetPlatform.iOS:
case TargetPlatform.Web:
options.OutputFiles.Add(Path.Combine(path, string.Format("lib{0}.a", name)));
break;
default: throw new InvalidPlatformException(options.Platform.Target);

View File

@@ -108,6 +108,7 @@ namespace Flax.Build
case TargetPlatform.Switch: return "PLATFORM_SWITCH";
case TargetPlatform.Mac: return "PLATFORM_MAC";
case TargetPlatform.iOS: return "PLATFORM_IOS";
case TargetPlatform.Web: return "PLATFORM_WEB";
default: throw new InvalidPlatformException(platform);
}
}

View File

@@ -170,7 +170,7 @@ namespace Flax.Build
/// <summary>
/// Gets the default project format used by the given platform.
/// </summary>
public abstract Projects.ProjectFormat DefaultProjectFormat { get; }
public virtual Projects.ProjectFormat DefaultProjectFormat => Projects.ProjectFormat.VisualStudioCode;
/// <summary>
/// Creates the toolchain for a given architecture.
@@ -343,6 +343,7 @@ namespace Flax.Build
case TargetPlatform.Switch: return targetArchitecture == TargetArchitecture.ARM64;
case TargetPlatform.Mac: return targetArchitecture == TargetArchitecture.ARM64 || targetArchitecture == TargetArchitecture.x64;
case TargetPlatform.iOS: return targetArchitecture == TargetArchitecture.ARM64;
case TargetPlatform.Web: return targetArchitecture == TargetArchitecture.x86;
default: return false;
}
}

View File

@@ -61,6 +61,11 @@ namespace Flax.Build
/// Running on iPhone.
/// </summary>
iOS = 11,
/// <summary>
/// Running on Web.
/// </summary>
Web = 12,
}
/// <summary>