PerPlatformBuildConfig

PerPlatformBuildConfig

#Overview

name: PerPlatformBuildConfig

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 PerPlatformBuildConfig is to store build configuration settings for different platforms in Unreal Engine 5. It is used to manage project packaging build configurations on a per-platform basis.

This setting variable is primarily used by the Developer Tools subsystem, specifically within the DeveloperToolSettings module. It is part of the UPlatformsMenuSettings class, which is likely used to configure platform-specific settings in the Unreal Engine editor.

The value of this variable is set through the UPlatformsMenuSettings::SetBuildConfigurationForPlatform function. This function adds or removes entries in the PerPlatformBuildConfig map based on the provided platform name and configuration.

PerPlatformBuildConfig interacts with the EProjectPackagingBuildConfigurations enum, which defines the possible build configurations. It also works alongside PerPlatformTargetFlavorName, another variable in the same class that stores target flavor names for different platforms.

Developers should be aware that:

  1. The variable uses FName as keys for platform names, so they should use consistent naming conventions for platforms.
  2. The special value EProjectPackagingBuildConfigurations::PPBC_MAX is used to indicate the default project setting case.
  3. Removing a platform’s configuration is done by setting it to PPBC_MAX.

Best practices when using this variable include:

  1. Always use the provided getter and setter functions (GetBuildConfigurationForPlatform and SetBuildConfigurationForPlatform) to interact with the variable, rather than accessing it directly.
  2. Be consistent with platform naming across the project to ensure proper configuration management.
  3. Consider the implications of setting or removing configurations for specific platforms, as it may affect the build process for those platforms.
  4. Regularly review and update the configurations to ensure they align with the project’s current requirements for each supported platform.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseGame.ini:161, section: [/Script/DeveloperToolSettings.PlatformsMenuSettings]

Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:189, section: [/Script/UnrealEd.ProjectPackagingSettings]

#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:44

Scope (from outer to inner):

file
class        class UPlatformsMenuSettings : public UObject

Source code excerpt:

	/** Per platform build configuration */
	UPROPERTY(config)
	TMap<FName, EProjectPackagingBuildConfigurations> PerPlatformBuildConfig;

	/** Per platform flavor cooking target */
	UPROPERTY(config)
	TMap<FName, FName> PerPlatformTargetFlavorName;

	/** Per platform build target */

#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/PlatformsMenuSettings.cpp:28

Scope (from outer to inner):

file
function     EProjectPackagingBuildConfigurations UPlatformsMenuSettings::GetBuildConfigurationForPlatform

Source code excerpt:

EProjectPackagingBuildConfigurations UPlatformsMenuSettings::GetBuildConfigurationForPlatform(FName PlatformName) const
{
	const EProjectPackagingBuildConfigurations* Value = PerPlatformBuildConfig.Find(PlatformName);

	// PPBC_MAX defines the default project setting case and should be handled accordingly.
	return Value == nullptr ? EProjectPackagingBuildConfigurations::PPBC_MAX : *Value;
}

void UPlatformsMenuSettings::SetBuildConfigurationForPlatform(FName PlatformName, EProjectPackagingBuildConfigurations Configuration)

#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/PlatformsMenuSettings.cpp:38

Scope (from outer to inner):

file
function     void UPlatformsMenuSettings::SetBuildConfigurationForPlatform

Source code excerpt:

	if (Configuration == EProjectPackagingBuildConfigurations::PPBC_MAX)
	{
		PerPlatformBuildConfig.Remove(PlatformName);
	}
	else
	{
		PerPlatformBuildConfig.Add(PlatformName, Configuration);
	}
}

FName UPlatformsMenuSettings::GetTargetFlavorForPlatform(FName FlavorName) const
{
	const FName* Value = PerPlatformTargetFlavorName.Find(FlavorName);