Get android cpu architecture in build.cs?

There any way to get android cpu architecture in build.cs file?
I has a problem with third party lib, that have different build libraries for different cpu architecture. I want to get specific libs for specific architecture in my build.cs file.

Target.Architecture contains target CPU architecture

Looking osme examples from other build.cs files in engine source code, you need to do Target.Architecture.StartsWith(“x86_64”) to check if runs on x86 64bit with 32 it will be just x86

here other hints of what that varbale may contain armeabi-armv7a, arm64-v8a, x86, x86_64

You can also use Contains function

As in post above,you can setup by yourself which architecture libs you have and you want to support.UE4 gives only the ability to setup,but doesnt have any enums for this,you should do it by yourself.You can take a look at any plugin that is under Runtime/Online in UE4

I tried to use Target.Architecture and its returns empty string for me. Also tried use it with StartsWith(), but give no result too.

Here a .build.cs file that I trying to do lib choose by it arch type, without comment&uncomment stuff.

Also, if you know how to do that you can do PR into this rep.

PS: Sorry for not direct comment to answer, for some reason I cannot anymore choose answers and leave comments under them.

After so many years I found this code to solve the problem:

if(Target.Platform == UnrealTargetPlatform.Android)
    IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
    var Architectures = ToolChain.GetAllArchitectures();
    foreach(var arch in Architectures)
        Log.TraceWarningOnce(string.Format("arch = {0}",arch));
1 Like