bBuildForArm64
bBuildForArm64
#Overview
name: bBuildForArm64
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. Also referenced in 2
C# build files meaning it may affect the build system logic.
#Summary
#Usage in the C++ source code
The purpose of bBuildForArm64 is to enable or disable support for the ARM64 (AArch64) CPU architecture when building an Android application using Unreal Engine 5. This setting is primarily related to the Android build system and determines whether the engine will compile and package code for ARM64 devices.
This setting variable is mainly used by the Android-specific modules of Unreal Engine, particularly:
- AndroidPlatformEditor
- AndroidTargetPlatformControls
- AndroidRuntimeSettings
The value of this variable is set in the Android Runtime Settings, which can be accessed and modified through the project settings in the Unreal Engine editor. It’s also possible to set this value programmatically, as seen in the HandleMetaQuestSupport function.
This variable interacts with other Android-related build settings, such as bBuildForX8664 (for x86-64 support) and bBuildForES31 (for OpenGL ES 3.1 support). It’s important to note that at least one architecture must be supported, so if both bBuildForX8664 and bBuildForArm64 are false, the engine will automatically set bBuildForArm64 to true.
Developers should be aware that:
- Enabling ARM64 support requires using at least NDK r11c and targets Android Lollipop (API level 21) or higher.
- This setting is crucial for supporting modern Android devices, as most high-end and mid-range devices now use ARM64 processors.
- Enabling this option may increase the size of the final APK, as it includes additional architecture-specific code.
Best practices when using this variable include:
- Enable ARM64 support unless you have a specific reason not to, as it’s the most common architecture for modern Android devices.
- Consider the target audience and device compatibility when deciding which architectures to support.
- Be aware of the increased APK size when supporting multiple architectures, and use app bundles or split APKs if possible to optimize distribution.
- Ensure that any third-party plugins or libraries used in the project also support ARM64 when this option is enabled.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:3039, section: [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]
- INI Section:
/Script/AndroidRuntimeSettings.AndroidRuntimeSettings
- Raw value:
true
- Is Array:
False
#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:306
Scope (from outer to inner):
file
function void FAndroidTargetSettingsCustomization::BuildAppManifestSection
Source code excerpt:
.ToolTip(FEngineBuildSettings::IsSourceDistribution() ? Tip : FAndroidTargetSettingsCustomizationConstants::DisabledTip); \
}
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"));
}
#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:409
Scope (from outer to inner):
file
class class UAndroidRuntimeSettings : public UObject
Source code excerpt:
// Enable Arm64 support?
UPROPERTY(GlobalConfig, EditAnywhere, Category = Build, meta = (DisplayName = "Support arm64 [aka arm64-v8a]"))
bool bBuildForArm64;
// 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)
#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Private/AndroidRuntimeSettings.cpp:108
Scope (from outer to inner):
file
function void UAndroidRuntimeSettings::HandleMetaQuestSupport
Source code excerpt:
}
if (!bBuildForArm64)
{
bBuildForArm64 = true;
UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bBuildForArm64)), GetDefaultConfigFilename());
UE_LOG(LogAndroidRuntimeSettings, Warning, TEXT("Support arm64 has been changed to true.\n"));
}
if (bSupportsVulkanSM5)
{
bSupportsVulkanSM5 = false;
UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bSupportsVulkanSM5)), GetDefaultConfigFilename());
#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Private/AndroidRuntimeSettings.cpp:130
Scope (from outer to inner):
file
function void UAndroidRuntimeSettings::HandleMetaQuestSupport
Source code excerpt:
UE_LOG(LogAndroidRuntimeSettings, Display, TEXT("Enabled Package for Meta Quest devices.\nThe following settings have been applied:\n"));
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");
#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)
{
if (PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bSupportsVulkan) ||
PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bBuildForES31))
#References in C# build files
This variable is referenced in the following C# build files:
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEBuildAndroid.cs:132
bool bUnsupportedBinaryBuildArch = false;
if (Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bBuildForArm64", out bBuild) && bBuild)
{
ActiveArches.Add("arm64");
}
if (Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bBuildForx8664", out bBuild) && bBuild)
{
ActiveArches.Add("x64");
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/ProjectFiles/VisualStudio/VCProjectFileGenerator.cs:265
bool bBuild;
if (Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bBuildForArm64", out bBuild) && bBuild)
{
ActiveArches.Add("arm64");
}
if (Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bBuildForx8664", out bBuild) && bBuild)
{
ActiveArches.Add("x64");