PerPlatformBuildTarget
PerPlatformBuildTarget
#Overview
name: PerPlatformBuildTarget
The value of this variable can be defined or overridden in .ini config files. 2
.ini config files referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of PerPlatformBuildTarget is to store and manage build target configurations for different platforms in Unreal Engine 5. It allows developers to specify unique build targets for each platform supported by their project.
This setting variable is primarily used by the Developer Tools subsystem, specifically within the PlatformsMenuSettings module. It’s part of the project configuration settings that help manage platform-specific build targets.
The value of this variable is set through the Unreal Editor’s project settings interface. It can also be programmatically modified using the SetBuildTargetForPlatform function in the UPlatformsMenuSettings class.
PerPlatformBuildTarget interacts with other platform-specific settings and is used in conjunction with the GetBuildTargetForPlatform function to retrieve the build target for a specific platform.
Developers must be aware that this variable is a TMap, mapping platform names (FName) to their respective build target names (FString). Empty string values are treated as the default project setting case.
Best practices when using this variable include:
- Ensuring that all supported platforms have appropriate build targets specified.
- Using consistent naming conventions for platform names and build targets.
- Regularly reviewing and updating the build targets to ensure they align with the project’s current requirements for each platform.
- Using the provided getter and setter functions (GetBuildTargetForPlatform and SetBuildTargetForPlatform) to interact with this variable, rather than accessing it directly.
- Being cautious when removing entries, as an empty string is treated differently from a non-existent entry.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseGame.ini:163, section: [/Script/DeveloperToolSettings.PlatformsMenuSettings]
- INI Section:
/Script/DeveloperToolSettings.PlatformsMenuSettings
- Raw value:
()
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:191, section: [/Script/UnrealEd.ProjectPackagingSettings]
- INI Section:
/Script/UnrealEd.ProjectPackagingSettings
- Raw value:
()
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Classes/Settings/PlatformsMenuSettings.h:52
Scope (from outer to inner):
file
class class UPlatformsMenuSettings : public UObject
Source code excerpt:
/** Per platform build target */
UPROPERTY(config, EditAnywhere, Category=Project)
TMap<FName, FString> PerPlatformBuildTarget;
};
#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/PlatformsMenuSettings.cpp:61
Scope (from outer to inner):
file
function FString UPlatformsMenuSettings::GetBuildTargetForPlatform
Source code excerpt:
FString UPlatformsMenuSettings::GetBuildTargetForPlatform(FName PlatformName) const
{
const FString* Value = PerPlatformBuildTarget.Find(PlatformName);
// empty string defines the default project setting case and should be handled accordingly.
return Value == nullptr ? "" : *Value;
}
void UPlatformsMenuSettings::SetBuildTargetForPlatform(FName PlatformName, FString BuildTargetName)
#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/PlatformsMenuSettings.cpp:71
Scope (from outer to inner):
file
function void UPlatformsMenuSettings::SetBuildTargetForPlatform
Source code excerpt:
if (BuildTargetName.IsEmpty())
{
PerPlatformBuildTarget.Remove(PlatformName);
}
else
{
PerPlatformBuildTarget.Add(PlatformName, BuildTargetName);
}
}
const FTargetInfo* UPlatformsMenuSettings::GetLaunchOnTargetInfo() const
{
return FindBestTargetInfo(LaunchOnTarget, true, nullptr);