Files
UnrealEngineUWP/Engine/Source/Developer/Windows/WindowsServerTargetPlatform/Private/WindowsServerTargetPlatformModule.cpp
Josh Adams 7efc6ca8c4 - Merged from FN/Main to 4.23:
- Added early check before creating a TargetPlatform object if the PlatformInfo will be found (check a static function to see if it's usable before making it)
- Changed each platform's GetTargetPlatform[s] function
#rb none
#jira UE-78692

[CL 8031412 by Josh Adams in 4.23 branch]
2019-08-14 11:13:59 -04:00

39 lines
863 B
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "GenericWindowsTargetPlatform.h"
#include "Interfaces/ITargetPlatformModule.h"
/** Holds the target platform singleton. */
static ITargetPlatform* Singleton = nullptr;
/**
* Module for the Windows target platform as a server.
*/
class FWindowsServerTargetPlatformModule
: public ITargetPlatformModule
{
public:
virtual ~FWindowsServerTargetPlatformModule( )
{
Singleton = nullptr;
}
virtual ITargetPlatform* GetTargetPlatform( )
{
if (Singleton == nullptr && TGenericWindowsTargetPlatform<false, true, false>::IsUsable())
{
Singleton = new TGenericWindowsTargetPlatform<false, true, false>();
}
return Singleton;
}
};
IMPLEMENT_MODULE(FWindowsServerTargetPlatformModule, WindowsServerTargetPlatform);