From f89e74c3deb8fbaf69038fb9972fa62deac9b731 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 15 Jul 2026 23:00:08 +0200 Subject: [PATCH] Fix build for blue platform four --- Source/Engine/Core/Compiler.h | 6 ++++++ Source/Engine/Platform/Platform.Build.cs | 1 + Source/ThirdParty/nethost/nethost.Build.cs | 6 +----- .../Flax.Build/Deps/Dependencies/nethost.cs | 16 +--------------- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/Source/Engine/Core/Compiler.h b/Source/Engine/Core/Compiler.h index 18381995b..4b1640ab0 100644 --- a/Source/Engine/Core/Compiler.h +++ b/Source/Engine/Core/Compiler.h @@ -121,3 +121,9 @@ #else #define IF_CONSTEXPR #endif + +// Custom attribute for Clang on PS4 +#if PLATFORM_PS4 +#undef DLLEXPORT +#define DLLEXPORT __declspec(dllexport) +#endif diff --git a/Source/Engine/Platform/Platform.Build.cs b/Source/Engine/Platform/Platform.Build.cs index b67158f4a..a6e16ba4c 100644 --- a/Source/Engine/Platform/Platform.Build.cs +++ b/Source/Engine/Platform/Platform.Build.cs @@ -55,6 +55,7 @@ public class Platform : EngineModule case TargetPlatform.PS4: options.SourcePaths.Add(Path.Combine(FolderPath, "Unix")); options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Platform")); + options.PrivateIncludePaths.Add(Path.Combine(Globals.EngineRoot, "Source/Platforms/PS4/Binaries/ThirdParty/x64/include/mono-2.0")); break; case TargetPlatform.PS5: options.SourcePaths.Add(Path.Combine(FolderPath, "Unix")); diff --git a/Source/ThirdParty/nethost/nethost.Build.cs b/Source/ThirdParty/nethost/nethost.Build.cs index d561eb68f..600f353c4 100644 --- a/Source/ThirdParty/nethost/nethost.Build.cs +++ b/Source/ThirdParty/nethost/nethost.Build.cs @@ -106,17 +106,13 @@ public class nethost : ThirdPartyModule options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.IO.Ports.Native.a")); options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.IO.Compression.Native.a")); options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libSystem.Globalization.Native.a")); - if (options.Platform.Target == TargetPlatform.PS5) + if (options.Platform.Target == TargetPlatform.PS5 || options.Platform.Target == TargetPlatform.PS4) { options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libbrotlicommon.a")); options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libbrotlidec.a")); options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libbrotlienc.a")); options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libz.a")); } - else if (options.Platform.Target == TargetPlatform.PS4) - { - options.OutputFiles.Add(Path.Combine(hostRuntime.Path, "libz.a")); - } } break; } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/nethost.cs b/Source/Tools/Flax.Build/Deps/Dependencies/nethost.cs index 35654e9af..a2f97755d 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/nethost.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/nethost.cs @@ -278,6 +278,7 @@ namespace Flax.Deps.Dependencies }; break; case TargetPlatform.PS5: + case TargetPlatform.PS4: libs1 = new[] { "lib/libmonosgen-2.0.a", @@ -295,21 +296,6 @@ namespace Flax.Deps.Dependencies "lib/libz.a", }; break; - case TargetPlatform.PS4: - libs1 = new[] - { - "lib/libmonosgen-2.0.a", - "lib/libmono-profiler-aot.a", - }; - libs2 = new[] - { - "lib/libSystem.Globalization.Native.a", - "lib/libSystem.IO.Compression.Native.a", - "lib/libSystem.IO.Ports.Native.a", - "lib/libSystem.Native.a", - "lib/libz.a", - }; - break; default: libs1 = new[] {