private void AddLibrary()

in Source/AmazonPollyMetaHuman/AmazonPollyMetaHuman.Build.cs [90:117]


    private void AddLibrary(string LibraryName) {
        string Platform = Target.Platform.ToString();
        string LibraryPath = Path.Combine(ModuleDirectory, "ThirdParty", "AwsSdk", Platform);

        if (Target.Platform == UnrealTargetPlatform.Win64) {
            // Add the library with symbols required by the linker (.lib for dynamic libraries on windows).
            PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "lib", LibraryName + ".lib"));

            // Stage the library along with the target, so it can be loaded at runtime.
            RuntimeDependencies.Add(
                "$(BinaryOutputDir)/" + LibraryName + ".dll",
                Path.Combine(LibraryPath, "bin", LibraryName + ".dll")
            );
        } else if (Target.Platform == UnrealTargetPlatform.Mac) {
            // Add the library with symbols required by the linker (.dylib for dynamic libraries on windows).
            PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "lib", "lib" + LibraryName + ".dylib"));

            // Stage the library along with the target, so it can be loaded at runtime.
            RuntimeDependencies.Add(
                "$(BinaryOutputDir)/lib" + LibraryName + ".dylib",
                Path.Combine(LibraryPath, "lib", "lib" + LibraryName + ".dylib")
            );
        } else {
            throw new PlatformNotSupportedException(
                "Platform " + Platform + " is not supported by the AwsSdk Module."
            );
        }
    }