Files
josh adams 1610c3bee3 UnrealArch/UnrealArchitectures changes
- Creates the UnrealArchitectures class, which wraps a list of UnrealArch objects
 - UnrealArch is a single architecture, expandable enum-like struct
 - There is no more concept of "no/default architecture", there is always a valid active architecture when building
 - Most uses of "string Architecture" are replaced with one of the two above, depending if multiple architectures are supported or not
 - UnrealArch has some platform-extensions for platform-specific naming (like Linux adds in LinuxName that turns, for instance, Arm64 -> aarch64-unknown-linux-gnueabi, which is used in folder names, etc)
 - UnrealArch has bIsX64 which can be used determine intel instruction set (as opposed to arm)
 - TargetRules class has an "Architecture" accessor that will return a single architecture if the active architectures is a single architecture, or throw an exception if multiple. This is useful in a majority of the cases where a paltform can only have a single architecture active in TargetRules (microsoft platforms, for instance, will create separate targets when compiling multiple architectures at once)
 - Added UnrealArchitectureConfig class, which contains all the architecture information for a platform (what architectures are supported, what ones are currently active for given project, etc)

#preflight 63c81fb5b065224750a1759e
#rb mike.fricker,roman.dzieciol,joe.kirchoff,dmytro.vovk,brandon.schaefer [various parts]
#p4v-preflight-copy 23562471

[CL 23829977 by josh adams in ue5-main branch]
2023-01-24 09:30:28 -05:00

71 lines
2.6 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System.IO;
using UnrealBuildTool;
public class Boost : ModuleRules
{
public Boost(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;
string BoostVersion = "1_80_0";
string[] BoostLibraries = { "atomic", "chrono", "filesystem", "iostreams", "program_options", "python39", "regex", "system", "thread" };
string BoostVersionDir = "boost-" + BoostVersion;
string BoostPath = Path.Combine(Target.UEThirdPartySourceDirectory, "Boost", BoostVersionDir);
string BoostIncludePath = Path.Combine(BoostPath, "include");
PublicSystemIncludePaths.Add(BoostIncludePath);
if (Target.Platform == UnrealTargetPlatform.Win64)
{
string BoostLibPath = Path.Combine(BoostPath, "lib", "Win64");
foreach (string BoostLib in BoostLibraries)
{
string BoostLibName = "boost_" + BoostLib + "-mt-x64";
PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, BoostLibName + ".lib"));
RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", BoostLibName + ".dll"), Path.Combine(BoostLibPath, BoostLibName + ".dll"));
}
PublicDefinitions.Add("BOOST_ALL_NO_LIB");
}
else if (Target.Platform == UnrealTargetPlatform.Mac)
{
string BoostLibPath = Path.Combine(BoostPath, "lib", "Mac");
foreach (string BoostLib in BoostLibraries)
{
// Note that these file names identify the universal binaries
// that support both x86_64 and arm64.
string BoostLibName = "libboost_" + BoostLib + "-mt-a64";
PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, BoostLibName + ".a"));
RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", BoostLibName + ".dylib"), Path.Combine(BoostLibPath, BoostLibName + ".dylib"));
}
}
else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
{
string BoostLibPath = Path.Combine(BoostPath, "lib", "Unix", Target.Architecture.LinuxName);
string BoostLibArchSuffix = "x64";
if (Target.Platform == UnrealTargetPlatform.LinuxArm64)
{
BoostLibArchSuffix = "a64";
}
foreach (string BoostLib in BoostLibraries)
{
string BoostLibName = "libboost_" + BoostLib + "-mt-" + BoostLibArchSuffix;
PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, BoostLibName + ".a"));
// Declare all version variations of the shared libraries as
// runtime dependencies.
foreach (string BoostSharedLibPath in Directory.EnumerateFiles(BoostLibPath, BoostLibName + ".so*"))
{
RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", Path.GetFileName(BoostSharedLibPath)), BoostSharedLibPath);
}
}
}
}
}