Files
FlaxEngine/Source/ThirdParty/SDL/SDL.Build.cs
Ari Vuollet 352591bcaa
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
_baseline emscripten build
2026-02-16 21:25:28 +02:00

60 lines
1.8 KiB
C#

// Copyright (c) Wojciech Figat. All rights reserved.
using System.IO;
using Flax.Build;
using Flax.Build.NativeCpp;
/// <summary>
/// https://www.libsdl.org/
/// </summary>
public class SDL : DepsModule
{
/// <inheritdoc />
public override void Init()
{
base.Init();
LicenseType = LicenseTypes.Custom;
LicenseFilePath = "LICENSE.txt";
// Merge third-party modules into engine binary
BinaryModuleName = "FlaxEngine";
}
/// <inheritdoc />
public override void Setup(BuildOptions options)
{
base.Setup(options);
var depsRoot = options.DepsFolder;
switch (options.Platform.Target)
{
case TargetPlatform.Windows:
options.OutputFiles.Add(Path.Combine(depsRoot, "SDL3.lib"));
options.OptionalDependencyFiles.Add(Path.Combine(depsRoot, "SDL3.pdb"));
options.OptionalDependencyFiles.Add(Path.Combine(depsRoot, "SDL3.dll"));
// For static linkage
options.OutputFiles.Add("Setupapi.lib");
options.OutputFiles.Add("Version.lib");
options.OutputFiles.Add("Imm32.lib");
options.OutputFiles.Add("Gdi32.lib");
break;
case TargetPlatform.Linux:
options.OutputFiles.Add(Path.Combine(depsRoot, "libSDL3.a"));
options.PublicDependencies.Add("libportal");
break;
case TargetPlatform.Mac:
options.OutputFiles.Add(Path.Combine(depsRoot, "libSDL3.a"));
break;
case TargetPlatform.Web:
options.OutputFiles.Add("--use-port=sdl3");
break;
default: throw new InvalidPlatformException(options.Platform.Target);
}
options.PublicIncludePaths.Add(Path.Combine(Globals.EngineRoot, @"Source\ThirdParty\SDL"));
}
}