Code style formatting and minor tweaks

#2800
This commit is contained in:
Wojtek Figat
2026-02-11 17:15:15 +01:00
parent 0bea701a83
commit 273b110db4
41 changed files with 108 additions and 116 deletions

View File

@@ -288,6 +288,7 @@ namespace Flax.Build
[CommandLine("useLogInRelease", "Can be used to disable logging in Release game builds")]
public static bool UseLogInRelease = true;
/// <summary>
/// True if SDL support should be enabled.
/// </summary>
[CommandLine("useSdl", "1 to enable SDL support in build")]
@@ -311,10 +312,14 @@ namespace Flax.Build
public static bool WithSDL(NativeCpp.BuildOptions options)
{
bool supportedPlatform = options.Platform.Target == TargetPlatform.Windows ||
options.Platform.Target == TargetPlatform.Linux ||
options.Platform.Target == TargetPlatform.Mac;
return UseSDL && supportedPlatform;
switch (options.Platform.Target)
{
case TargetPlatform.Windows:
case TargetPlatform.Linux:
case TargetPlatform.Mac:
return UseSDL;
default: return false;
}
}
}
}

View File

@@ -175,7 +175,7 @@ namespace Flax.Deps.Dependencies
RunCmake(cmakeFolder, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + cmakeArgs, envVars);
// Run build
BuildCmake(cmakeFolder, envVars: envVars);
BuildCmake(cmakeFolder, envVars);
// Deploy binaries
var libs = new[]

View File

@@ -3,15 +3,12 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using Flax.Build;
using Flax.Build.Platforms;
namespace Flax.Deps.Dependencies
{
/// <summary>
///
/// Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.
/// </summary>
/// <seealso cref="Flax.Deps.Dependency" />
class SDL : Dependency

View File

@@ -53,13 +53,16 @@ namespace Flax.Build.Platforms
options.LinkEnv.InputLibraries.Add("QuartzCore.framework");
options.LinkEnv.InputLibraries.Add("AVFoundation.framework");
// SDL3 requires the following frameworks:
options.LinkEnv.InputLibraries.Add("Foundation.framework");
options.LinkEnv.InputLibraries.Add("GameController.framework");
options.LinkEnv.InputLibraries.Add("Carbon.framework");
options.LinkEnv.InputLibraries.Add("ForceFeedback.framework");
options.LinkEnv.InputLibraries.Add("UniformTypeIdentifiers.framework");
options.LinkEnv.InputLibraries.Add("CoreHaptics.framework");
if (EngineConfiguration.WithSDL(options))
{
// SDL3 requires the following frameworks:
options.LinkEnv.InputLibraries.Add("Foundation.framework");
options.LinkEnv.InputLibraries.Add("GameController.framework");
options.LinkEnv.InputLibraries.Add("Carbon.framework");
options.LinkEnv.InputLibraries.Add("ForceFeedback.framework");
options.LinkEnv.InputLibraries.Add("UniformTypeIdentifiers.framework");
options.LinkEnv.InputLibraries.Add("CoreHaptics.framework");
}
}
protected override void AddArgsCommon(BuildOptions options, List<string> args)

View File

@@ -411,7 +411,7 @@ namespace Flax.Build.Platforms
// Use shared arguments
args.Clear();
args.AddRange(commonArgs);
// Language for the file
args.Add("-x");
if (Path.GetExtension(sourceFile).Equals(".c", StringComparison.OrdinalIgnoreCase))
@@ -419,7 +419,7 @@ namespace Flax.Build.Platforms
else
{
args.Add("c++");
// C++ version
switch (compileEnvironment.CppVersion)
{