_baseline emscripten build

This commit is contained in:
2026-02-16 21:25:28 +02:00
parent 9158e1c270
commit d7d37bce01
8 changed files with 56 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
# Redirect to our own Git LFS server
[lfs]
url="https://gitlab.flaxengine.com/flax/flaxengine.git/info/lfs"
#url="https://gitlab.flaxengine.com/flax/flaxengine.git/info/lfs"
locksverify = false

View File

@@ -121,7 +121,7 @@ namespace FlaxEditor.GUI
}
// Select the first platform
_selected = platforms[0].PlatformType;
_selected = PlatformType.Web;
((Image)Children[0]).Color = _selectedColor;
((Image)Children[0]).MouseOverColor = _selectedColor;
}

View File

@@ -83,7 +83,7 @@ namespace FlaxEditor.Windows
public bool ShowOutput = true;
[EditorOrder(20), Tooltip("Configuration build mode")]
public BuildConfiguration ConfigurationMode = BuildConfiguration.Development;
public BuildConfiguration ConfigurationMode = BuildConfiguration.Debug;
[EditorOrder(90), Tooltip("The list of custom defines passed to the build tool when compiling project scripts. Can be used in build scripts for configuration (Configuration.CustomDefines).")]
public string[] CustomDefines;

View File

@@ -50,7 +50,7 @@ public class SDL : DepsModule
break;
case TargetPlatform.Web:
options.OutputFiles.Add("--use-port=sdl3");
return;
break;
default: throw new InvalidPlatformException(options.Platform.Target);
}

View File

@@ -24,6 +24,7 @@ namespace Flax.Deps.Dependencies
return new[]
{
TargetPlatform.Windows,
TargetPlatform.Web,
};
case TargetPlatform.Linux:
return new[]

View File

@@ -97,6 +97,7 @@ namespace Flax.Deps
TargetPlatform.PS5,
TargetPlatform.Android,
TargetPlatform.Switch,
TargetPlatform.Web,
};
case TargetPlatform.Linux:
return new[]
@@ -129,6 +130,7 @@ namespace Flax.Deps
{
TargetArchitecture.x64,
TargetArchitecture.ARM64,
TargetArchitecture.x86,
};
case TargetPlatform.Linux:
return new[]

View File

@@ -1,6 +1,7 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
@@ -43,7 +44,7 @@ namespace Flax.Deps
if (Configuration.BuildArchitectures != null && Configuration.BuildArchitectures.Length != 0)
architectures = Configuration.BuildArchitectures;
architectures = architectures.Where(buildPlatform.CanBuildArchitecture).ToArray();
Log.Verbose($"Building deps for platforms {string.Join(',', platforms)}, {string.Join(',', architectures)}:");
Log.Verbose($"Building deps for platforms [{string.Join(", ", platforms)}] with architectures [{string.Join(", ", architectures)}]:");
foreach (var platform in platforms)
{
foreach (var architecture in architectures)
@@ -59,49 +60,63 @@ namespace Flax.Deps
var dependencies = Builder.BuildTypes.Where(x => x.IsSubclassOf(typeof(Dependency))).Select(Activator.CreateInstance).Cast<Dependency>().ToArray();
if (dependencies.Length == 0)
Log.Warning("No dependencies found!");
List<Dependency> failedDependencies = new();
for (var i = 0; i < dependencies.Length; i++)
{
var dependency = dependencies[i];
var name = dependency.GetType().Name;
if (depsToBuild.Length > 0 || !dependency.BuildByDefault)
try
{
if (!depsToBuild.Contains(name.ToLower()))
var name = dependency.GetType().Name;
if (depsToBuild.Length > 0 || !dependency.BuildByDefault)
{
if (!depsToBuild.Contains(name.ToLower()))
{
Log.Info(string.Format("Skipping {0} ({1}/{2})", name, i + 1, dependencies.Length));
Log.Verbose("Not selected for build.");
continue;
}
}
options.Platforms = platforms.Intersect(dependency.Platforms).ToArray();
if (options.Platforms.Length == 0)
{
Log.Info(string.Format("Skipping {0} ({1}/{2})", name, i + 1, dependencies.Length));
Log.Verbose("Not selected for build.");
Log.Verbose("Not used on any of the build platforms.");
continue;
}
}
options.Platforms = platforms.Intersect(dependency.Platforms).ToArray();
if (options.Platforms.Length == 0)
options.Architectures = architectures.Intersect(dependency.Architectures).ToArray();
if (options.Architectures.Length == 0)
{
Log.Info(string.Format("Skipping {0} ({1}/{2})", name, i + 1, dependencies.Length));
Log.Verbose("Architecture not used on any of the build platforms.");
continue;
}
Log.Info(string.Format("Building {0} ({1}/{2})", name, i + 1, dependencies.Length));
options.IntermediateFolder = Path.Combine(Environment.CurrentDirectory, "Cache", "Intermediate", "Deps", name).Replace('\\', '/');
if (!Configuration.ReBuildDeps && Directory.Exists(options.IntermediateFolder))
{
Log.Verbose(string.Format("{0} is up-to-date. Skipping build.", name));
continue;
}
var forceEmpty = false; //Configuration.ReBuildDeps;
Dependency.SetupDirectory(options.IntermediateFolder, forceEmpty);
dependency.Build(options);
}
catch (Exception e)
{
Log.Info(string.Format("Skipping {0} ({1}/{2})", name, i + 1, dependencies.Length));
Log.Verbose("Not used on any of the build platforms.");
continue;
failedDependencies.Add(dependency);
Log.Error(e.ToString());
}
}
options.Architectures = architectures.Intersect(dependency.Architectures).ToArray();
if (options.Architectures.Length == 0)
{
Log.Info(string.Format("Skipping {0} ({1}/{2})", name, i + 1, dependencies.Length));
Log.Verbose("Architecture not used on any of the build platforms.");
continue;
}
Log.Info(string.Format("Building {0} ({1}/{2})", name, i + 1, dependencies.Length));
options.IntermediateFolder = Path.Combine(Environment.CurrentDirectory, "Cache", "Intermediate", "Deps", name).Replace('\\', '/');
if (!Configuration.ReBuildDeps && Directory.Exists(options.IntermediateFolder))
{
Log.Verbose(string.Format("{0} is up-to-date. Skipping build.", name));
continue;
}
var forceEmpty = false; //Configuration.ReBuildDeps;
Dependency.SetupDirectory(options.IntermediateFolder, forceEmpty);
dependency.Build(options);
if (failedDependencies.Count > 0)
{
Log.Error("Failed to build the following dependencies: " + string.Join(", ", failedDependencies.Select(x => x.GetType().Name)));
}
Log.Info("Done!");

View File

@@ -76,8 +76,8 @@ namespace Flax.Build.Platforms
public override bool CanBuildArchitecture(TargetArchitecture targetArchitecture)
{
// Prevent generating configuration data for Windows x86 (deprecated)
if (targetArchitecture == TargetArchitecture.x86)
return false;
//if (targetArchitecture == TargetArchitecture.x86)
// return false;
// Check if we have a compiler for this architecture
var toolsets = GetToolsets();