Files
sbox-public/engine/Tools/SboxBuild/Steps/GenerateSolutions.cs
Lorenz Junglas a4da4caa26 Audio System Refactor (#4925)
* Remove some dead native sound code

* Rewrite managed audio system to be lock-free

Use a snapshot triple buffering approach (main thread collect snapshots -> mixingthread processes), similar to how we handle batch drawing (mainthread collects snapshots -> render threads processes)

* Remove/Rework managed steam audio abstraction

* Add just Steam Audio effects, build ourselves via vpc

Compile steamaudio with AVX1
2026-05-26 19:49:54 +02:00

81 lines
3.4 KiB
C#

using static Facepunch.Constants;
namespace Facepunch.Steps;
/// <summary>
/// Step to generate Visual Studio solutions without building them
/// </summary>
internal class GenerateSolutions( string name, BuildConfiguration configuration = BuildConfiguration.Developer ) : Step( name )
{
private readonly Platform platform = Platform.Create();
protected override ExitCode RunInternal()
{
// Generate solutions based on configuration
if ( configuration == BuildConfiguration.Retail )
{
return GenerateRetailSolutions();
}
else
{
return GenerateDeveloperSolutions( configuration );
}
}
private ExitCode GenerateRetailSolutions()
{
Log.Info( "Generating Retail solutions..." );
string vpcPath = Path.Combine( "src", "devtools", "bin", platform.PlatformID, "vpc" );
// Generate schemacompiler_all solution
if ( !Utility.RunProcess( vpcPath, $"/mksln schemacompiler_all /define:BUILDBOT /retail /checkfiles /checkfiles_error /quiet /fi /fc /forceunity /define:PUBLISH /2026 /sbox /{platform.PlatformID} \"@schemacompiler_all\" /defdmacro:SBOX=1", "src" ) )
return ExitCode.Failure;
// Generate buildbot_all_win64 solution
if ( !Utility.RunProcess( vpcPath, $"/mksln buildbot_all_{platform.PlatformID} /define:BUILDBOT /retail /checkfiles /checkfiles_error /quiet /fi /fc /forceunity /define:PUBLISH /2026 /sbox /{platform.PlatformID} +everything +native_everything +sbox_game /defdmacro:SBOX=1", "src" ) )
return ExitCode.Failure;
// Generate buildbot_tools_win64 solution
// Used to rebuild tools on Windows, because sometimes it corrupts which is insane
if ( platform is WindowsPlatform )
{
if ( !Utility.RunProcess( vpcPath, $"/mksln buildbot_tools_{platform.PlatformID} /define:BUILDBOT /retail /checkfiles /checkfiles_error /quiet /fi /fc /forceunity /define:PUBLISH /2026 /{platform.PlatformID} +hammer +modeldoc_editor +animgraph_editor /defdmacro:SBOX=1", "src" ) )
return ExitCode.Failure;
}
return ExitCode.Success;
}
private ExitCode GenerateDeveloperSolutions( BuildConfiguration configuration )
{
Log.Info( "Generating Developer solutions..." );
string vpcPath = Path.Combine( "src", "devtools", "bin", platform.PlatformID, "vpc" );
string extraDefines = "";
if ( configuration == BuildConfiguration.DeveloperMemoryDebug )
{
Log.Info( "Using Memory Debug macros" );
extraDefines = "/define:MEMDEBUG_TRACKING";
}
// Generate schemacompiler_all solution
Log.Info( "Generating Schema Compiler solution" );
if ( !Utility.RunProcess( vpcPath, $"/mksln schemacompiler_all {extraDefines} /checkfiles /checkfiles_error /forceunity /2026 /sbox /{platform.PlatformID} \"@schemacompiler_all\" /defdmacro:SBOX=1", "src" ) )
return ExitCode.Failure;
// Generate sbox_game solution
Log.Info( "Generating sbox_game solution" );
if ( !Utility.RunProcess( vpcPath, $"/mksln sbox_game {extraDefines} /checkfiles /checkfiles_error /forceunity /2026 /sbox /{platform.PlatformID} +sbox_game /defdmacro:SBOX=1", "src" ) )
return ExitCode.Failure;
// Generate developer_all_win64 solution
Log.Info( "Generating full engine solution" );
if ( !Utility.RunProcess( vpcPath, $"/mksln developer_all_{platform.PlatformID} {extraDefines} /checkfiles /checkfiles_error /forceunity /2026 /sbox /{platform.PlatformID} +everything +native_everything +sbox_game /defdmacro:SBOX=1", "src" ) )
return ExitCode.Failure;
return ExitCode.Success;
}
}