diff --git a/Source/UniversalLogging/Private/UniversalLogging.cpp b/Source/UniversalLogging/Private/UniversalLogging.cpp index 5163d4ee5addbd5c28d49dd9bf65ae6e241e247e..390fc0768aba17aaad43da3ac38441c219f86ea3 100644 --- a/Source/UniversalLogging/Private/UniversalLogging.cpp +++ b/Source/UniversalLogging/Private/UniversalLogging.cpp @@ -3,8 +3,10 @@ #include "LogStream.h" #include "GameFramework/PlayerController.h" #include "GameFramework/HUD.h" +#if PLATFORM_WINDOWS || PLATFORM_LINUX #include "IDisplayCluster.h" #include "Cluster/IDisplayClusterClusterManager.h" +#endif #include "Misc/CommandLine.h" LogFileManager UniversalLoggingImpl::Log_File_Manager{}; @@ -156,6 +158,7 @@ void UniversalLoggingImpl::ResetSessionId(FString Prefix) bool UniversalLoggingImpl::IsClusterMaster() { +#if PLATFORM_WINDOWS || PLATFORM_LINUX if (!IDisplayCluster::IsAvailable()) { return true; @@ -166,14 +169,21 @@ bool UniversalLoggingImpl::IsClusterMaster() return true; // if we are not in cluster mode, we are always the master } return Manager->IsMaster() || !Manager->IsSlave(); +#else + return true; +#endif } FString UniversalLoggingImpl::GetNodeName() { +#if PLATFORM_WINDOWS || PLATFORM_LINUX if (IDisplayCluster::Get().GetOperationMode() == EDisplayClusterOperationMode::Cluster) return IDisplayCluster::Get().GetClusterMgr()->GetNodeId(); else return FString(TEXT("Localhost")); +#else + return FString(TEXT("Localhost")); +#endif } LogFileManager* UniversalLoggingImpl::GetLogFileManager() diff --git a/Source/UniversalLogging/Public/IUniversalLogging.h b/Source/UniversalLogging/Public/IUniversalLogging.h index a08dd4b7f82778399cf46955652bf35306baf716..b76c7ec2ebc693c33a0700873d3e7c1d244ee217 100644 --- a/Source/UniversalLogging/Public/IUniversalLogging.h +++ b/Source/UniversalLogging/Public/IUniversalLogging.h @@ -1,6 +1,9 @@ #pragma once +#if PLATFORM_WINDOWS || PLATFORM_LINUX #include "IDisplayCluster.h" +#endif + #include "Modules/ModuleManager.h" #include "ILogStream.h" diff --git a/Source/UniversalLogging/UniversalLogging.Build.cs b/Source/UniversalLogging/UniversalLogging.Build.cs index 7b3353af536c2fd00338ffe53462715d19bdfcb2..df6cdf3082a25d049762bab3caba7b97632037e1 100644 --- a/Source/UniversalLogging/UniversalLogging.Build.cs +++ b/Source/UniversalLogging/UniversalLogging.Build.cs @@ -12,6 +12,11 @@ public class UniversalLogging : ModuleRules PrivateIncludePaths.AddRange(new string[] { }); PublicIncludePaths.AddRange(new string[] { }); - PublicDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "Core", "DisplayCluster" }); + PublicDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "Core" }); + + if (Target.Platform == UnrealTargetPlatform.Linux || Target.Platform == UnrealTargetPlatform.Win64) + { + PublicDependencyModuleNames.AddRange(new string[] { "DisplayCluster" }); + } } } \ No newline at end of file diff --git a/UniversalLogging.uplugin b/UniversalLogging.uplugin index dd492a55d49642f9ef1d3e1b6006bb7674d505e7..1a06157f1a411190fef66082a8bace1b46200d61 100644 --- a/UniversalLogging.uplugin +++ b/UniversalLogging.uplugin @@ -20,7 +20,11 @@ "Plugins": [ { "Name": "nDisplay", - "Enabled": true + "Enabled": true, + "WhitelistPlatforms": [ + "Win64", + "Linux" + ] } ] } \ No newline at end of file