// Copyright Epic Games, Inc. All Rights Reserved. using UnrealBuildTool; using System.IO; public class Protobuf : ModuleRules { protected readonly string Version = "3.18.0"; public Protobuf(ReadOnlyTargetRules Target) : base(Target) { Type = ModuleType.External; PublicDependencyModuleNames.Add("zlib"); string VersionPath = Path.Combine(ModuleDirectory, Version); string LibraryPath = Path.Combine(VersionPath, "lib"); PublicSystemIncludePaths.Add(Path.Combine(VersionPath, "include")); if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix)) { PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "Unix", Target.Architecture.LinuxName, "Release", "libprotobuf.a")); } else if (Target.Platform == UnrealTargetPlatform.Mac) { PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "Mac", "Release", "libprotobuf.a")); } else if (Target.Platform == UnrealTargetPlatform.Win64) { PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "Win64", Target.Architecture.WindowsLibDir, "Release", "libprotobuf.lib")); } PublicDefinitions.Add("WITH_PROTOBUF"); } }