bBuildForX8664

bBuildForX8664

#Overview

name: bBuildForX8664

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bBuildForX8664 is to enable or disable support for the x86-64 (also known as x64) CPU architecture when building an Android application using Unreal Engine 5.

This setting variable is primarily used by the Android platform-specific modules of Unreal Engine, specifically:

  1. AndroidPlatformEditor
  2. AndroidTargetPlatformControls
  3. AndroidRuntimeSettings

The value of this variable is set in the Android Runtime Settings, which can be accessed through the project settings in the Unreal Engine editor. It’s a boolean value, so it can be either true or false.

bBuildForX8664 interacts with other architecture-related variables, particularly bBuildForArm64. The engine ensures that at least one architecture is always supported. If both bBuildForX8664 and bBuildForArm64 are false, the engine will automatically set bBuildForArm64 to true.

Developers should be aware of the following:

  1. This setting is currently intended for full source games only, as indicated by a comment in the code.
  2. When packaging for Meta Quest devices, this setting is automatically set to false and cannot be enabled.
  3. Enabling this option will increase the size of the application package, as it includes binaries for an additional architecture.

Best practices when using this variable include:

  1. Only enable it if you specifically need to support x86-64 Android devices, which are less common than ARM-based devices.
  2. Consider the trade-off between broader device support and increased application size.
  3. Be aware of any performance implications when testing on x86-64 Android devices compared to ARM devices.
  4. Ensure that any third-party plugins or libraries you’re using also support the x86-64 architecture if you enable this option.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3040, section: [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/Android/AndroidPlatformEditor/Private/AndroidTargetSettingsCustomization.cpp:307

Scope (from outer to inner):

file
function     void FAndroidTargetSettingsCustomization::BuildAppManifestSection

Source code excerpt:

	}
	SETUP_ANDROIDARCH_PROP(TEXT("arm64"), bBuildForArm64, BuildCategory, LOCTEXT("BuildForArm64ToolTip", "Enable Arm64 CPU architecture support? (use at least NDK r11c, requires Lollipop (android-21) minimum)"));
	SETUP_ANDROIDARCH_PROP(TEXT("x64"), bBuildForX8664, BuildCategory, LOCTEXT("BuildForX8664ToolTip", "Enable X86-64 CPU architecture support?"));

	// @todo android fat binary: Put back in when we expose those
//	SETUP_SOURCEONLY_PROP(bSplitIntoSeparateApks, BuildCategory, LOCTEXT("SplitIntoSeparateAPKsToolTip", "If checked, CPU architectures and rendering types will be split into separate .apk files"));
}

bool FAndroidTargetSettingsCustomization::IsLicenseInvalid() const

#Loc: <Workspace>/Engine/Source/Developer/Android/AndroidTargetPlatformControls/Private/AndroidTargetPlatformControls.h:112

Scope (from outer to inner):

file
class        class FAndroidTargetPlatformControls : public TNonDesktopTargetPlatformControlsBase<FAndroidPlatformProperties>
function     virtual void GetBuildProjectSettingKeys

Source code excerpt:

	{
		OutSection = TEXT("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings");
		InBoolKeys.Add(TEXT("bBuildForArm64"));	InBoolKeys.Add(TEXT("bBuildForX8664"));
		InBoolKeys.Add(TEXT("bBuildForES31")); InBoolKeys.Add(TEXT("bBuildWithHiddenSymbolVisibility"));
		InBoolKeys.Add(TEXT("bSaveSymbols")); InStringKeys.Add(TEXT("NDKAPILevel"));
	}

	virtual bool ShouldExpandTo32Bit(const uint16* Indices, const int32 NumIndices) const override;
	//~ End ITargetPlatform Interface

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Classes/AndroidRuntimeSettings.h:413

Scope (from outer to inner):

file
class        class UAndroidRuntimeSettings : public UObject

Source code excerpt:

	// Enable x86-64 support? [CURRENTLY FOR FULL SOURCE GAMES ONLY]
	UPROPERTY(GlobalConfig, EditAnywhere, Category = Build, meta = (DisplayName = "Support x86_64 [aka x64]", EditCondition = "!bPackageForMetaQuest"))
	bool bBuildForX8664;

	// Include shaders for devices supporting OpenGL ES 3.2 and above (default)
	UPROPERTY(GlobalConfig, EditAnywhere, Category = Build, meta = (DisplayName = "Support OpenGL ES3.2", EditCondition = "!bPackageForMetaQuest"))
	bool bBuildForES31;

	// Support the Vulkan RHI and include Vulkan shaders

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Private/AndroidRuntimeSettings.cpp:101

Scope (from outer to inner):

file
function     void UAndroidRuntimeSettings::HandleMetaQuestSupport

Source code excerpt:

	if (bPackageForMetaQuest)
	{
		if (bBuildForX8664)
		{
			bBuildForX8664 = false;
			UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bBuildForX8664)), GetDefaultConfigFilename());
			UE_LOG(LogAndroidRuntimeSettings, Warning, TEXT("Support x86_64 has been changed to false.\n"));

		}
		if (!bBuildForArm64)
		{
			bBuildForArm64 = true;

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Private/AndroidRuntimeSettings.cpp:132

Scope (from outer to inner):

file
function     void UAndroidRuntimeSettings::HandleMetaQuestSupport

Source code excerpt:

		UE_LOG(LogAndroidRuntimeSettings, Display, TEXT("Support arm64: %d.\n"), bBuildForArm64);
		UE_LOG(LogAndroidRuntimeSettings, Display, TEXT("Support Vulkan: %d.\n"), bSupportsVulkan);
		UE_LOG(LogAndroidRuntimeSettings, Display, TEXT("Support x86_64: %d.\n"), bBuildForX8664);
		UE_LOG(LogAndroidRuntimeSettings, Display, TEXT("Support Vulkan Desktop: %d.\n"), bSupportsVulkanSM5);
		UE_LOG(LogAndroidRuntimeSettings, Display, TEXT("Support OpenGL ES3.2: %d."), bBuildForES31);

		int32 SupportedDevicesTagIndex = ExtraApplicationSettings.Find("com.oculus.supportedDevices");
		FString SupportedDevicesValue("quest|quest2|questpro|quest3");
		int32 SupportedDevicesIndex = ExtraApplicationSettings.Find(SupportedDevicesValue);

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Private/AndroidRuntimeSettings.cpp:187

Scope (from outer to inner):

file
function     void UAndroidRuntimeSettings::PostEditChangeProperty

Source code excerpt:


	// Ensure that at least one architecture is supported
	if (!bBuildForX8664 && !bBuildForArm64)
	{
		bBuildForArm64 = true;
		UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bBuildForArm64)), GetDefaultConfigFilename());
	}

	if (PropertyChangedEvent.Property != nullptr)