public CloudWatchSDK(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
        PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private"));
        PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public"));

        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Projects", "Engine" });

        PublicDefinitions.Add("USE_IMPORT_EXPORT");
        PublicDefinitions.Add("USE_WINDOWS_DLL_SEMANTICS");

        // This is required to fix a warning for Unreal Engine 4.21 and later
        PrivatePCHHeaderFile = "Private/CloudWatchSDKPrivatePCH.h";

        bEnableExceptions = true;

        string BaseDirectory = System.IO.Path.GetFullPath(System.IO.Path.Combine(ModuleDirectory, "..", ".."));
        string SDKDirectory  = System.IO.Path.Combine(BaseDirectory, "ThirdParty", "CloudWatchSDK", Target.Platform.ToString());

        bool bHasGameLiftSDK = System.IO.Directory.Exists(SDKDirectory);

        if (bHasGameLiftSDK)
        {
            if (Target.Type == TargetRules.TargetType.Server)
            {
                PublicDefinitions.Add("WITH_CLOUDWATCH=1");
            }
            else
            {
                PublicDefinitions.Add("WITH_CLOUDWATCH=0");
            }

            PublicLibraryPaths.Add(SDKDirectory);

            // aws-c-common
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(SDKDirectory, "aws-c-common.lib"));
            PublicDelayLoadDLLs.Add("aws-c-common.dll");
            RuntimeDependencies.Add(System.IO.Path.Combine(SDKDirectory, "aws-c-common.dll"));

            // aws-c-event-stream
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(SDKDirectory, "aws-c-event-stream.lib"));
            PublicDelayLoadDLLs.Add("aws-c-event-stream.dll");
            RuntimeDependencies.Add(System.IO.Path.Combine(SDKDirectory, "aws-c-event-stream.dll"));

            // aws-checksums
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(SDKDirectory, "aws-checksums.lib"));
            PublicDelayLoadDLLs.Add("aws-checksums.dll");
            RuntimeDependencies.Add(System.IO.Path.Combine(SDKDirectory, "aws-checksums.dll"));

            // aws-cpp-sdk-core
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(SDKDirectory, "aws-cpp-sdk-core.lib"));
            PublicDelayLoadDLLs.Add("aws-cpp-sdk-core.dll");
            RuntimeDependencies.Add(System.IO.Path.Combine(SDKDirectory, "aws-cpp-sdk-core.dll"));

            // aws-cpp-sdk-monitoring
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(SDKDirectory, "aws-cpp-sdk-monitoring.lib"));
            PublicDelayLoadDLLs.Add("aws-cpp-sdk-monitoring.dll");
            RuntimeDependencies.Add(System.IO.Path.Combine(SDKDirectory, "aws-cpp-sdk-monitoring.dll"));

            // aws-cpp-sdk-logs
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(SDKDirectory, "aws-cpp-sdk-logs.lib"));
            PublicDelayLoadDLLs.Add("aws-cpp-sdk-logs.dll");
            RuntimeDependencies.Add(System.IO.Path.Combine(SDKDirectory, "aws-cpp-sdk-logs.dll"));
        }
        else
        {
            PublicDefinitions.Add("WITH_CLOUDWATCH=0");
        }
    }
Пример #2
0
    public KlawrClrHostNative(TargetInfo Target)
    {
        // This module is built externally, just need to let UBT know the include and library paths
        // that should be passed through to any targets that depend on this module.
        Type = ModuleType.External;

        var moduleName = this.GetType().Name;
        // path to directory containing this Build.cs file
//        var basePath = Path.GetDirectoryName(RulesCompiler.GetModuleFilename(moduleName));
        var basePath = Path.GetDirectoryName(ModuleDirectory);

        string architecture = null;

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            architecture = "x64";
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            architecture = "x86";
        }
        else
        {
            architecture = "x64";
        }

        string configuration = null;

        switch (Target.Configuration)
        {
        case UnrealTargetConfiguration.Debug:
        case UnrealTargetConfiguration.DebugGame:
            configuration = BuildConfiguration.bDebugBuildsActuallyUseDebugCRT ? "Debug" : "Release";
            break;

        default:
            configuration = "Release";
            break;
        }

        Console.WriteLine("KlawrClrHostNative Target.Configuration: " + configuration);

        if ((architecture != null) && (configuration != null))
        {
            PublicIncludePaths.Add(Path.Combine(basePath, "Public"));
            var libName = "Klawr.ClrHost.Native-" + architecture + "-" + configuration + ".lib";
            PublicLibraryPaths.Add(Path.Combine(basePath, "..", "Build"));
            PublicAdditionalLibraries.Add(libName);
        }

        // copy the CLR host assembly (assumed to have been built previously) to the engine binaries
        // directory so that it can be found and loaded at runtime by the unmanaged CLR host

        string hostAssemblyName      = "Klawr.ClrHost.Managed";
        string hostAssemblyDLL       = hostAssemblyName + ".dll";
        string hostAssemblyPDB       = hostAssemblyName + ".pdb";
        string hostAssemblySourceDir = Path.Combine(basePath, Path.Combine("ClrHostManaged", "bin", configuration));

        Utils.CollapseRelativeDirectories(ref hostAssemblySourceDir);

        string binariesDir = Path.Combine(
            BuildConfiguration.RelativeEnginePath, "Binaries", Target.Platform.ToString()
            );

        bool bOverwrite = true;

        var from = Path.Combine(hostAssemblySourceDir, hostAssemblyDLL);
        var to   = Path.Combine(binariesDir, hostAssemblyDLL);

        if (!File.Exists(to))
        {
            var msg = "Copy: " + from + "\nTo: " + to;
            Log.TraceInformation(msg);
            File.Copy(from, to, bOverwrite);
        }
        from = Path.Combine(hostAssemblySourceDir, hostAssemblyPDB);
        to   = Path.Combine(binariesDir, hostAssemblyPDB);
        if (!File.Exists(to))
        {
            File.Copy(from, to, bOverwrite);
        }
    }
Пример #3
0
    public HarfBuzz(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        // Can't be used without our dependencies
        if (!Target.bCompileFreeType || !Target.bCompileICU)
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=0");
            return;
        }

        string HarfBuzzVersion  = "harfbuzz-1.2.4";
        string HarfBuzzRootPath = Target.UEThirdPartySourceDirectory + "HarfBuzz/" + HarfBuzzVersion + "/";

        // Includes
        PublicSystemIncludePaths.Add(HarfBuzzRootPath + "src" + "/");

        string PlatformFolderName = Target.Platform.ToString();

        string HarfBuzzLibPath = HarfBuzzRootPath + PlatformFolderName + "/";

        if ((Target.Platform == UnrealTargetPlatform.Win64) ||
            (Target.Platform == UnrealTargetPlatform.Win32))
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=1");

            string VSVersionFolderName = "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
            HarfBuzzLibPath += VSVersionFolderName + "/";

            string BuildTypeFolderName = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT)
                                ? "Debug"
                                : "RelWithDebInfo";
            HarfBuzzLibPath += BuildTypeFolderName + "/";

            PublicLibraryPaths.Add(HarfBuzzLibPath);
            PublicAdditionalLibraries.Add("harfbuzz.lib");
        }

        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=1");

            string OpimizationSuffix = "_Oz";             // i.e. bCompileForSize
            if (!Target.bCompileForSize)
            {
                switch (Target.Configuration)
                {
                case UnrealTargetConfiguration.Development:
                    OpimizationSuffix = "_O2";
                    break;

                case UnrealTargetConfiguration.Shipping:
                    OpimizationSuffix = "_O3";
                    break;

                default:
                    OpimizationSuffix = "";
                    break;
                }
            }
            PublicAdditionalLibraries.Add(HarfBuzzRootPath + "HTML5/libharfbuzz" + OpimizationSuffix + ".bc");
        }

        else if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=1");

            PublicAdditionalLibraries.Add(HarfBuzzLibPath + "libharfbuzz.a");
        }

        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=1");

            string BuildTypeFolderName = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT)
                                ? "Debug"
                                : "Release";
            HarfBuzzLibPath += BuildTypeFolderName + "/";

            PublicLibraryPaths.Add(HarfBuzzLibPath);
            PublicAdditionalLibraries.Add("harfbuzz");             // Automatically transforms to libharfbuzz.a
        }

        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=1");

            string BuildTypeFolderName = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT)
                                ? "Debug"
                                : "Release";
            HarfBuzzLibPath += "VS2015/" + BuildTypeFolderName + "/";

            PublicLibraryPaths.Add(HarfBuzzLibPath);
            PublicAdditionalLibraries.Add("harfbuzz.lib");
        }

        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=1");

            string BuildTypeFolderName = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT)
                                ? "Debug/"
                                : "Release/";

            PublicLibraryPaths.Add(HarfBuzzRootPath + "Android/ARMv7/" + BuildTypeFolderName);
            PublicLibraryPaths.Add(HarfBuzzRootPath + "Android/ARM64/" + BuildTypeFolderName);
            PublicLibraryPaths.Add(HarfBuzzRootPath + "Android/x86/" + BuildTypeFolderName);
            PublicLibraryPaths.Add(HarfBuzzRootPath + "Android/x64/" + BuildTypeFolderName);

            PublicAdditionalLibraries.Add("harfbuzz");
        }

        else
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=0");
        }
    }
    public AdMob(TargetInfo Target)
    {
        PublicIncludePaths.AddRange(
            new string[] {
            "AdMob/Public"

            // ... add public include paths required here ...
        }
            );

        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",

            // ... add other public dependencies that you statically link with here ...
        }
            );


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "Slate",
            "SlateCore",
            "AdCollection",

            // ... add private dependencies that you statically link with here ...
        }
            );


        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );


        if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PrivateIncludePaths.Add("Private/IOS");
            PrivateIncludePaths.Add("../AdCollection/ThirdPartyFrameworks/VungleAdmobIOS/");

            string strStaticPath = Path.GetFullPath(Path.Combine(ModulePath, "../AdCollection/ThirdPartyFrameworks/VungleAdmobIOS/"));

            PublicLibraryPaths.Add(strStaticPath);

            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "GoogleMobileAds",                                                                                                  // Framework name
                    "../AdCollection/ThirdPartyFrameworks/GoogleMobileAds.embeddedframework.zip")
                );

            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "UnityAds",                                                                                                 // Framework name
                    "../AdCollection/ThirdPartyFrameworks/UnityAds.embeddedframework.zip")
                );


            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "VungleSDK",                                                                                                        // Framework name
                    "../AdCollection/ThirdPartyFrameworks/VungleSDK.embeddedframework.zip")
                );

            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "Chartboost",                                                                                                       // Framework name
                    "../AdCollection/ThirdPartyFrameworks/Chartboost.embeddedframework.zip")
                );


            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "AdColony",                                                                                                 // Framework name
                    "../AdCollection/ThirdPartyFrameworks/AdColony-iOS-SDK-3.zip")
                );


            // adapter
            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "UnityAdapter",                                                                                                     // Framework name
                    "../AdCollection/ThirdPartyFrameworks/UnityAdapter-2.1.0.0.zip")
                );

            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "ChartboostAdapter",                                                                                                        // Framework name
                    "../AdCollection/ThirdPartyFrameworks/ChartboostAdapter-6.6.3.0.zip")
                );


            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "AdColonyAdapter",                                                                                                  // Framework name
                    "../AdCollection/ThirdPartyFrameworks/AdColonyAdapter-3.1.1.0.zip")
                );


            // helper lib
            PublicAdditionalFrameworks.Add(
                new UEBuildFramework(
                    "AdsUtil",                                                                                                  // Framework name
                    "../AdCollection/ThirdPartyFrameworks/AdsUtil.embeddedframework.zip")
                );

            PublicAdditionalLibraries.Add("VungleAdapter");
            PublicAdditionalShadowFiles.Add("../AdCollection/ThirdPartyFrameworks/VungleAdmobIOS/libVungleAdapter.a");


            PublicFrameworks.AddRange(
                new string[]
            {
                "EventKit",
                "MediaPlayer",
                "AdSupport",
                "CoreLocation",
                "SystemConfiguration",
                "MessageUI",
                "Security",
                "CoreTelephony"
            }
                );
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PrivateIncludePaths.Add("Private/Android");
            PrivateDependencyModuleNames.AddRange(
                new string[] {
                "Launch",
            }
                );

            string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, BuildConfiguration.RelativeEnginePath);
            AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", Path.Combine(PluginPath, "AdMob_UPL.xml")));
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
        {
            PrivateIncludePaths.Add("Private/Windows");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PrivateIncludePaths.Add("Private/Mac");
        }
        else
        {
            PrecompileForTargets = PrecompileTargetsType.None;
        }
    }
Пример #5
0
    public CS_OpenSSL(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string OpenSSL101sPath = Path.Combine(Target.UEThirdPartySourceDirectory, "OpenSSL", "1_0_1s");
        string OpenSSL102hPath = Path.Combine(Target.UEThirdPartySourceDirectory, "OpenSSL", "1_0_2h");
        string OpenSSL102Path  = Path.Combine(Target.UEThirdPartySourceDirectory, "OpenSSL", "1.0.2g");
        string OpenSSL111Path  = Path.Combine(Target.UEThirdPartySourceDirectory, "OpenSSL", "1.1.1");

        string PlatformSubdir = Target.Platform.ToString();
        string ConfigFolder   = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT) ? "Debug" : "Release";

        if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicIncludePaths.Add(Path.Combine(OpenSSL102Path, "include", PlatformSubdir));

            string LibPath = Path.Combine(OpenSSL102Path, "lib", PlatformSubdir, ConfigFolder);
            //PublicLibraryPaths.Add(LibPath);
            PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libssl.a"));
            PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libcrypto.a"));
            PublicAdditionalLibraries.Add("z");
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            string IncludePath = Target.UEThirdPartySourceDirectory + "OpenSSL/1.0.2g" + "/" + "include/PS4";
            string LibraryPath = Target.UEThirdPartySourceDirectory + "OpenSSL/1.0.2g" + "/" + "lib/PS4/release";
            PublicIncludePaths.Add(IncludePath);
            PublicAdditionalLibraries.Add(LibraryPath + "/" + "libssl.a");
            PublicAdditionalLibraries.Add(LibraryPath + "/" + "libcrypto.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32)
        {
            // Our OpenSSL 1.1.1 libraries are built with zlib compression support
            PrivateDependencyModuleNames.Add("zlib");

            // string VSVersion = "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
            string VSVersion = "VS2015";
            // Add includes
            PublicIncludePaths.Add(Path.Combine(OpenSSL111Path, "include", PlatformSubdir, VSVersion));

            // Add Libs
            string LibPath = Path.Combine(OpenSSL111Path, "lib", PlatformSubdir, VSVersion, ConfigFolder);
            PublicLibraryPaths.Add(LibPath);

            PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libssl.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libcrypto.lib"));
            PublicAdditionalLibraries.Add("crypt32.lib");
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            string platform    = "/Linux/" + Target.Architecture;
            string IncludePath = OpenSSL102hPath + "/include" + platform;
            string LibraryPath = OpenSSL102hPath + "/lib" + platform;

            PublicIncludePaths.Add(IncludePath);
            PublicLibraryPaths.Add(LibraryPath);
            PublicAdditionalLibraries.Add(LibraryPath + "/libssl.a");
            PublicAdditionalLibraries.Add(LibraryPath + "/libcrypto.a");

            PublicDependencyModuleNames.Add("zlib");
            //			PublicAdditionalLibraries.Add("z");
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            string IncludePath = OpenSSL101sPath + "/include/Android";
            PublicIncludePaths.Add(IncludePath);

            // unneeded since included in libcurl
            // string LibPath = Path.Combine(OpenSSL101sPath, "lib", PlatformSubdir);
            //PublicLibraryPaths.Add(LibPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            string IncludePath = OpenSSL101sPath + "/include/IOS";
            string LibraryPath = OpenSSL101sPath + "/lib/IOS";

            PublicIncludePaths.Add(IncludePath);

            PublicAdditionalLibraries.Add(LibraryPath + "/libssl.a");
            PublicAdditionalLibraries.Add(LibraryPath + "/libcrypto.a");
        }
    }
Пример #6
0
    public WebSocket(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivatePCHHeaderFile = "Public/WebSocket.h";

        string strEngineDir     = GetEngineDirectory();
        string strEngineVersion = ReadEngineVersion(strEngineDir);

        System.Console.WriteLine("version:" + strEngineVersion);

        PrivateIncludePaths.AddRange(
            new string[] {
            "WebSocket/Private",
            // ... add other private include paths required here ...
        }
            );


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "Json",
            "JsonUtilities",
            "Sockets",
            // ... add other public dependencies that you statically link with here ...
        }
            );


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "Slate",
            "SlateCore",
            "Json",
            "JsonUtilities",
            // ... add private dependencies that you statically link with here ...
        }
            );


        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );


        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicDefinitions.Add("PLATFORM_UWP=0");
            PrivateDependencyModuleNames.Add("zlib");
            if (EngineMinorVersion == "21" || EngineMinorVersion == "20")
            {
                PrivateDependencyModuleNames.Add("OpenSSL");
            }

            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Win64");
            string strStaticPath = Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/Win64/"));
            //PublicLibraryPaths.Add(strStaticPath);

            // for 4.21
            if (EngineMinorVersion == "21" || EngineMinorVersion == "20")
            {
                string[] StaticLibrariesX64 = new string[] {
                    "websockets_static.lib",
                };

                foreach (string Lib in StaticLibrariesX64)
                {
                    PublicAdditionalLibraries.Add(strStaticPath + Lib);
                }
            }
            else
            {
                // for 4.22 and beyond
                if (Target.Type == TargetType.Editor)
                {
                    PublicAdditionalLibraries.Add(strStaticPath + "websockets_static422.lib");
                    PublicAdditionalLibraries.Add(strStaticPath + "libeay32.lib");
                    PublicAdditionalLibraries.Add(strStaticPath + "ssleay32.lib");
                }
                else
                {
                    PublicAdditionalLibraries.Add(strStaticPath + "websockets_game_static422.lib");
                }
            }
        }
        if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            PublicDefinitions.Add("PLATFORM_UWP=0");
            PrivateDependencyModuleNames.Add("zlib");
            PrivateDependencyModuleNames.Add("OpenSSL");
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Win32");

            string strStaticPath = Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/Win32/"));
            PublicLibraryPaths.Add(strStaticPath);

            // 4.22 and 4.21
            if (EngineMinorVersion == "21" || EngineMinorVersion == "20")
            {
                string[] StaticLibrariesX32 = new string[] {
                    "websockets_static.lib",
                    //"libcrypto.lib",
                    //"libssl.lib",
                };

                foreach (string Lib in StaticLibrariesX32)
                {
                    PublicAdditionalLibraries.Add(Lib);
                }
            }
            else if (EngineMinorVersion == "22")
            {
                string[] StaticLibrariesX32 = new string[] {
                    "websockets_static422.lib",
                    //"libcrypto.lib",
                    //"libssl.lib",
                };

                foreach (string Lib in StaticLibrariesX32)
                {
                    PublicAdditionalLibraries.Add(Lib);
                }
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicDefinitions.Add("PLATFORM_UWP=0");
            string strStaticPath = Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/HTML5/"));
            PublicLibraryPaths.Add(strStaticPath);

            string[] StaticLibrariesHTML5 = new string[] {
                "WebSocket.js",
            };

            foreach (string Lib in StaticLibrariesHTML5)
            {
                PublicAdditionalLibraries.Add(strStaticPath + Lib);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicDefinitions.Add("PLATFORM_UWP=0");
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Mac");
            string strStaticPath = Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/Mac/"));
            //PublicLibraryPaths.Add(strStaticPath);

            string[] StaticLibrariesMac = new string[] {
                "libwebsockets.a",
                "libssl.a",
                "libcrypto.a"
            };

            foreach (string Lib in StaticLibrariesMac)
            {
                PublicAdditionalLibraries.Add(Path.Combine(strStaticPath, Lib));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            PublicDefinitions.Add("PLATFORM_UWP=0");
            PrivateDependencyModuleNames.Add("OpenSSL");
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Linux");
            string strStaticPath = Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/Linux/"));
            PublicLibraryPaths.Add(strStaticPath);

            string[] StaticLibrariesMac = new string[] {
                "libwebsockets.a",
                //"libssl.a",
                //"libcrypto.a"
            };

            foreach (string Lib in StaticLibrariesMac)
            {
                PublicAdditionalLibraries.Add(Path.Combine(strStaticPath, Lib));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicDefinitions.Add("PLATFORM_UWP=0");
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/IOS");

            string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath + "/Source/");
            PluginPath = PluginPath.Replace("\\", "/");

            string strStaticPath = PluginPath + "/ThirdParty/lib/IOS/";// Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/IOS/"));
            PublicLibraryPaths.Add(strStaticPath);

            string[] StaticLibrariesIOS = new string[] {
                "websockets",
                "ssl",
                "crypto"
            };

            foreach (string Lib in StaticLibrariesIOS)
            {
                PublicAdditionalLibraries.Add(Lib);
                PublicAdditionalShadowFiles.Add(Path.Combine(strStaticPath, "lib" + Lib + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicDefinitions.Add("PLATFORM_UWP=0");
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Android");
            string strStaticPath = Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/Android/armeabi-v7a"));
            PublicLibraryPaths.Add(strStaticPath);

            string strStaticArm64Path = Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/Android/arm64-v8a"));
            PublicLibraryPaths.Add(strStaticArm64Path);


            string[] StaticLibrariesAndroid = new string[] {
                "websockets",
                "ssl",
                "crypto"
            };

            foreach (string Lib in StaticLibrariesAndroid)
            {
                PublicAdditionalLibraries.Add(Lib);
            }
        }
    }
Пример #7
0
    public Python(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string PythonRoot        = null;
        string PythonIncludePath = null;
        string PythonLibPath     = null;
        string PythonLibName     = null;

        if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux)
        {
            // Check for an explicit version before using the auto-detection logic
            PythonRoot = System.Environment.GetEnvironmentVariable("UE_PYTHON_DIR");
        }

        // Perform auto-detection to try and find the Python root
        if (PythonRoot == null)
        {
            var KnownPaths = new List <string>();

            // todo: This isn't correct for cross-compilation, we need to consider the host platform too
            if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
            {
                KnownPaths.AddRange(
                    new string[] {
                    //"C:/Program Files/Python36",
                    "C:/Python27",
                }
                    );
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                KnownPaths.AddRange(
                    new string[] {
                    "/Library/Frameworks/Python.framework/Versions/2.7",
                    //"/System/Library/Frameworks/Python.framework/Versions/2.7",
                }
                    );
            }

            foreach (var KnownPath in KnownPaths)
            {
                if (Directory.Exists(KnownPath))
                {
                    PythonRoot = KnownPath;
                    break;
                }
            }
        }

        // Work out the include path
        if (PythonRoot != null)
        {
            PythonIncludePath = Path.Combine(PythonRoot, (Target.Platform == UnrealTargetPlatform.Mac) ? "Headers" : "include");
            if (!Directory.Exists(PythonIncludePath))
            {
                PythonRoot = null;
            }
        }

        // Work out the lib path
        if (PythonRoot != null)
        {
            string LibFolder      = null;
            string LibNamePattern = null;
            switch (Target.Platform)
            {
            case UnrealTargetPlatform.Win32:
            case UnrealTargetPlatform.Win64:
                LibFolder      = "libs";
                LibNamePattern = "python*.lib";
                break;

            case UnrealTargetPlatform.Mac:
                LibFolder      = "lib";
                LibNamePattern = "libpython*.dylib";
                break;

            case UnrealTargetPlatform.Linux:
                LibFolder      = "lib";
                LibNamePattern = "libpython*.so";
                break;

            default:
                break;
            }

            if (LibFolder != null && LibNamePattern != null)
            {
                PythonLibPath = Path.Combine(PythonRoot, LibFolder);

                if (Directory.Exists(PythonLibPath))
                {
                    string[] MatchingLibFiles = Directory.GetFiles(PythonLibPath, LibNamePattern);
                    if (MatchingLibFiles.Length > 0)
                    {
                        PythonLibName = Path.GetFileName(MatchingLibFiles[0]);
                    }
                }
            }

            if (PythonLibPath == null || PythonLibName == null)
            {
                PythonRoot = null;
            }
        }

        // Make sure the Python install is the correct architecture
        if (PythonRoot != null)
        {
            string ExpectedPointerSizeResult = Target.Platform == UnrealTargetPlatform.Win32 ? "4" : "8";

            // Invoke Python to query the pointer size of the interpreter so we can work out whether it's 32-bit or 64-bit
            // todo: We probably need to do this for all platforms, but right now it's only an issue on Windows
            if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
            {
                string PythonBinary = Path.Combine(PythonRoot, "python");
                string Result       = InvokePython(PythonBinary, "-c \"import struct; print(struct.calcsize('P'))\"");
                Result = Result != null?Result.Replace("\r", "").Replace("\n", "") : null;

                if (Result == null || Result != ExpectedPointerSizeResult)
                {
                    PythonRoot = null;
                }
            }
        }

        if (PythonRoot == null)
        {
            PublicDefinitions.Add("WITH_PYTHON=0");
        }
        else
        {
            PublicDefinitions.Add("WITH_PYTHON=1");
            PublicDefinitions.Add(string.Format("UE_PYTHON_DIR=\"{0}\"", PythonRoot.Replace('\\', '/')));

            // Some versions of Python need this define set when building on MSVC
            if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
            {
                PublicDefinitions.Add("HAVE_ROUND=1");
            }

            PublicSystemIncludePaths.Add(PythonIncludePath);
            if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                // Mac doesn't understand PublicLibraryPaths
                PublicAdditionalLibraries.Add(Path.Combine(PythonLibPath, PythonLibName));
            }
            else
            {
                PublicLibraryPaths.Add(PythonLibPath);
                PublicAdditionalLibraries.Add(PythonLibName);
            }
        }
    }
    public UEOpenExr(TargetInfo Target)
    {
        Type = ModuleType.External;
        if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Mac)
        {
            bool   bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT);
            string LibDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "openexr/Deploy/lib/";
            string Platform;
            switch (Target.Platform)
            {
            case UnrealTargetPlatform.Win64:
                Platform = "x64";
                LibDir  += "VS" + WindowsPlatform.GetVisualStudioCompilerVersionName() + "/";
                break;

            case UnrealTargetPlatform.Win32:
                Platform = "Win32";
                LibDir  += "VS" + WindowsPlatform.GetVisualStudioCompilerVersionName() + "/";
                break;

            case UnrealTargetPlatform.Mac:
                Platform = "Mac";
                bDebug   = false;
                break;

            default:
                return;
            }
            LibDir = LibDir + "/" + Platform;
            LibDir = LibDir + "/Static" + (bDebug ? "Debug" : "Release");
            PublicLibraryPaths.Add(LibDir);

            if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32)
            {
                PublicAdditionalLibraries.AddRange(
                    new string[] {
                    "Half.lib",
                    "Iex.lib",
                    "IlmImf.lib",
                    "IlmThread.lib",
                    "Imath.lib",
                }
                    );
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                PublicAdditionalLibraries.AddRange(
                    new string[] {
                    LibDir + "/libHalf.a",
                    LibDir + "/libIex.a",
                    LibDir + "/libIlmImf.a",
                    LibDir + "/libIlmThread.a",
                    LibDir + "/libImath.a",
                }
                    );
            }

            PublicSystemIncludePaths.AddRange(
                new string[] {
                UEBuildConfiguration.UEThirdPartySourceDirectory + "openexr/Deploy/include",
            }
                );
        }
    }
Пример #9
0
    public libgltf_ue4(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string        glTFPath    = System.IO.Path.Combine(ModuleDirectory, "libgltf-0.1.6");
        string        IncludePath = System.IO.Path.Combine(glTFPath, "include");
        List <string> LibPaths    = new List <string>();
        string        LibFilePath = "";

        if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
        {
            string PlatformName = "";
            switch (Target.Platform)
            {
            case UnrealTargetPlatform.Win32:
                PlatformName = "win32";
                break;

            case UnrealTargetPlatform.Win64:
                PlatformName = "win64";
                break;
            }

            string TargetConfiguration = "Release";
            string TargetPostfix       = "";
            if (Target.Configuration == UnrealTargetConfiguration.Debug)
            {
                TargetConfiguration = "Debug";
                TargetPostfix       = "d";
            }

            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", PlatformName, "vs2019", TargetConfiguration));

            LibFilePath = "libgltf" + TargetPostfix + ".lib";
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "linux"));

            LibFilePath = "libgltf.a";
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "macos"));

            LibFilePath = "libgltf.a";
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "android", "armeabi-v7a"));
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "android", "armeabi-v7a-with-neon"));
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "android", "arm64-v8a"));
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "android", "x86"));
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "android", "x86_64"));

            LibFilePath = "libgltf.a";
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "ios", "os"));
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "ios", "simulator"));
            LibPaths.Add(System.IO.Path.Combine(glTFPath, "lib", "ios", "watchos"));

            LibFilePath = "libgltf.a";
        }

        PublicIncludePaths.Add(IncludePath);
        PublicLibraryPaths.AddRange(LibPaths);
        PublicAdditionalLibraries.Add(LibFilePath);
        PublicDefinitions.Add("LIBGLTF_CHARACTOR_ENCODING_IS_UTF8");
    }
Пример #10
0
    public APEX(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        // Determine which kind of libraries to link against
        APEXLibraryMode LibraryMode   = GetAPEXLibraryMode(Target.Configuration);
        string          LibrarySuffix = GetAPEXLibrarySuffix(LibraryMode);

        string ApexVersion = "APEX_1.4";

        string APEXDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/" + ApexVersion + "/";

        string APEXLibDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/Lib";

        PublicSystemIncludePaths.AddRange(
            new string[] {
            APEXDir + "include",
            APEXDir + "include/clothing",
            APEXDir + "include/destructible",
            APEXDir + "include/nvparameterized",
            APEXDir + "include/legacy",
            APEXDir + "include/PhysX3",
            APEXDir + "common/include",
            APEXDir + "common/include/autogen",
            APEXDir + "framework/include",
            APEXDir + "framework/include/autogen",
            APEXDir + "shared/general/RenderDebug/public",
            APEXDir + "shared/general/PairFilter/include",
            APEXDir + "shared/internal/include",
            APEXDir + "externals/CUDA_6.5.19/include",
        }
            );

        // List of default library names (unused unless LibraryFormatString is non-null)
        List <string> ApexLibraries = new List <string>();

        ApexLibraries.AddRange(
            new string[]
        {
            "ApexCommon{0}",
            "ApexFramework{0}",
            "ApexShared{0}",
            "APEX_Destructible{0}",
            "APEX_Clothing{0}",
        });
        string LibraryFormatString = null;

        bool bIsApexStaticallyLinked = false;
        bool bHasApexLegacy          = true;

        // Libraries and DLLs for windows platform
        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            APEXLibDir += "/Win64/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(APEXLibDir);

            PublicAdditionalLibraries.Add(String.Format("APEXFramework{0}_x64.lib", LibrarySuffix));
            PublicDelayLoadDLLs.Add(String.Format("APEXFramework{0}_x64.dll", LibrarySuffix));

            string[] RuntimeDependenciesX64 =
            {
                "APEX_Clothing{0}_x64.dll",
                "APEX_Destructible{0}_x64.dll",
                "APEX_Legacy{0}_x64.dll",
                "ApexFramework{0}_x64.dll",
            };

            string ApexBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX/Win64/VS{0}/", WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string RuntimeDependency in RuntimeDependenciesX64)
            {
                string FileName = ApexBinariesDir + String.Format(RuntimeDependency, LibrarySuffix);
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }
            if (LibrarySuffix != "")
            {
                Definitions.Add("UE_APEX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            APEXLibDir += "/Win32/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(APEXLibDir);

            PublicAdditionalLibraries.Add(String.Format("APEXFramework{0}_x86.lib", LibrarySuffix));
            PublicDelayLoadDLLs.Add(String.Format("APEXFramework{0}_x86.dll", LibrarySuffix));

            string[] RuntimeDependenciesX86 =
            {
                "APEX_Clothing{0}_x86.dll",
                "APEX_Destructible{0}_x86.dll",
                "APEX_Legacy{0}_x86.dll",
                "ApexFramework{0}_x86.dll",
            };

            string ApexBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX/Win32/VS{0}/", WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string RuntimeDependency in RuntimeDependenciesX86)
            {
                string FileName = ApexBinariesDir + String.Format(RuntimeDependency, LibrarySuffix);
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }
            if (LibrarySuffix != "")
            {
                Definitions.Add("UE_APEX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            APEXLibDir += "/Mac";

            ApexLibraries.Clear();
            ApexLibraries.AddRange(
                new string[]
            {
                "ApexCommon{0}",
                "ApexShared{0}",
            });

            LibraryFormatString = APEXLibDir + "/lib{0}" + ".a";

            string[] DynamicLibrariesMac = new string[] {
                "/libAPEX_Clothing{0}.dylib",
                "/libAPEX_Destructible{0}.dylib",
                "/libAPEX_Legacy{0}.dylib",
                "/libApexFramework{0}.dylib"
            };

            string PhysXBinariesDir = UEBuildConfiguration.UEThirdPartyBinariesDirectory + "PhysX/Mac";
            foreach (string Lib in DynamicLibrariesMac)
            {
                string LibraryPath = PhysXBinariesDir + String.Format(Lib, LibrarySuffix);
                PublicDelayLoadDLLs.Add(LibraryPath);
                RuntimeDependencies.Add(new RuntimeDependency(LibraryPath));
            }
            if (LibrarySuffix != "")
            {
                Definitions.Add("UE_APEX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.Architecture.StartsWith("x86_64"))
            {
                APEXLibDir += "/Linux/" + Target.Architecture;
                bIsApexStaticallyLinked = true;

                ApexLibraries.Add("APEX_Clothing{0}");
                ApexLibraries.Add("APEX_Destructible{0}");
                ApexLibraries.Add("APEX_Legacy{0}");
                ApexLibraries.Add("ApexFramework{0}");
                LibraryFormatString = APEXLibDir + "/lib{0}" + ".a";
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            bIsApexStaticallyLinked = true;
            bHasApexLegacy          = false;

            APEXLibDir += "/PS4";
            PublicLibraryPaths.Add(APEXLibDir);

            ApexLibraries.Add("NvParameterized{0}");
            ApexLibraries.Add("RenderDebug{0}");

            LibraryFormatString = "{0}";
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            bIsApexStaticallyLinked = true;
            bHasApexLegacy          = false;

            Definitions.Add("_XBOX_ONE=1");

            // This MUST be defined for XboxOne!
            Definitions.Add("PX_HAS_SECURE_STRCPY=1");

            APEXLibDir += "/XboxOne/VS2015";
            PublicLibraryPaths.Add(APEXLibDir);

            ApexLibraries.Add("NvParameterized{0}");
            ApexLibraries.Add("RenderDebug{0}");

            LibraryFormatString = "{0}.lib";
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            bIsApexStaticallyLinked = true;
            bHasApexLegacy          = false;

            APEXLibDir += "/Switch";
            PublicLibraryPaths.Add(APEXLibDir);

            ApexLibraries.Add("NvParameterized{0}");
            ApexLibraries.Add("RenderDebug{0}");

            LibraryFormatString = "{0}";
        }

        Definitions.Add("APEX_UE4=1");

        Definitions.Add(string.Format("APEX_STATICALLY_LINKED={0}", bIsApexStaticallyLinked ? 1 : 0));
        Definitions.Add(string.Format("WITH_APEX_LEGACY={0}", bHasApexLegacy ? 1 : 0));

        // Add the libraries needed (used for all platforms except Windows)
        if (LibraryFormatString != null)
        {
            foreach (string Lib in ApexLibraries)
            {
                string ConfiguredLib = String.Format(Lib, LibrarySuffix);
                string FinalLib      = String.Format(LibraryFormatString, ConfiguredLib);
                PublicAdditionalLibraries.Add(FinalLib);
            }
        }
    }
    public AgogCore(TargetInfo Target)
    {
        Type = ModuleType.External;

        var bPlatformAllowed = false;

        string platPathSuffix = Target.Platform.ToString();
        string libPathExt     = ".a";
        bool   useDebugCRT    = BuildConfiguration.bDebugBuildsActuallyUseDebugCRT;

        switch (Target.Platform)
        {
        case UnrealTargetPlatform.Win32:
            bPlatformAllowed = true;
            platPathSuffix   = Path.Combine("Win32", "VS2013");
            libPathExt       = ".lib";
            Definitions.Add("WIN32_LEAN_AND_MEAN");
            break;

        case UnrealTargetPlatform.Win64:
            bPlatformAllowed = true;
            platPathSuffix   = Path.Combine("Win64", "VS2013");
            libPathExt       = ".lib";
            Definitions.Add("WIN32_LEAN_AND_MEAN");
            break;

        case UnrealTargetPlatform.IOS:
            bPlatformAllowed = true;
            Definitions.Add("A_PLAT_iOS");
            Definitions.Add("NO_AGOG_PLACEMENT_NEW");
            Definitions.Add("A_NO_GLOBAL_EXCEPTION_CATCH");
            useDebugCRT = true;
            break;
        }

        string libNameSuffix = "";

        // NOTE: All modules inside the SkookumScript plugin folder must use the exact same definitions!
        switch (Target.Configuration)
        {
        case UnrealTargetConfiguration.Debug:
        case UnrealTargetConfiguration.DebugGame:
            Definitions.Add("A_EXTRA_CHECK=1");
            Definitions.Add("A_UNOPTIMIZED=1");
            Definitions.Add("SKOOKUM=31");
            libNameSuffix = useDebugCRT ? "-Debug" : "-DebugCRTOpt";
            break;

        case UnrealTargetConfiguration.Development:
        case UnrealTargetConfiguration.Test:
            Definitions.Add("A_EXTRA_CHECK=1");
            Definitions.Add("SKOOKUM=31");
            libNameSuffix = "-Development";
            break;

        case UnrealTargetConfiguration.Shipping:
            Definitions.Add("A_SYMBOL_STR_DB=1");
            Definitions.Add("A_NO_SYMBOL_REF_LINK=1");
            Definitions.Add("SKOOKUM=8");
            libNameSuffix = "-Shipping";
            break;
        }

        PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public"));

        if (bPlatformAllowed)
        {
            var buildNumber = "1703";
            var moduleName  = "AgogCore";

            // Get local file path where the library is located
            var libFileName = moduleName + libNameSuffix + libPathExt;
            var libDirPath  = Path.Combine(ModuleDirectory, "..", "..", "Intermediate", "Lib", buildNumber, platPathSuffix);
            var libFilePath = Path.Combine(libDirPath, libFileName);
            if (!File.Exists(libFilePath))
            {
                // Does not exist, try to download it
                if (!File.Exists(libDirPath))
                {
                    Directory.CreateDirectory(libDirPath);
                }
                var       libUrl = ("http://download.skookumscript.com/beta/" + buildNumber + "/lib/" + platPathSuffix + "/" + libFileName).Replace('\\', '/');
                WebClient client = new WebClient();
                try
                {
                    Log.TraceInformation("Downloading build {0} of {1}...", buildNumber, libFileName);
                    client.DownloadFile(libUrl, @libFilePath);
                    Log.TraceInformation("Success!");
                }
                catch (System.Exception)
                {
                    if (File.Exists(libFilePath))
                    {
                        File.Delete(libFilePath);
                    }
                    throw new BuildException("Could not download {0}!", libUrl);
                }
            }
            // Check if a newer custom built library exists that we want to use instead
            var builtLibDirPath  = Path.Combine(ModuleDirectory, "Lib", platPathSuffix);
            var builtLibFilePath = Path.Combine(builtLibDirPath, libFileName);
            if (File.Exists(builtLibFilePath) && (!File.Exists(libFilePath) || (File.GetLastWriteTime(builtLibFilePath) > File.GetLastWriteTime(libFilePath))))
            {
                Log.TraceInformation("Using locally built AgogCore.");
                libDirPath  = builtLibDirPath;
                libFilePath = builtLibFilePath;
            }
            PublicLibraryPaths.Add(libDirPath);
            PublicAdditionalLibraries.Add(libFilePath);
            Log.TraceVerbose("{0} library added to path: {1}", moduleName, libDirPath);
        }
    }
Пример #12
0
    public glTFForUE4(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage             = PCHUsageMode.UseSharedPCHs;
        PrivatePCHHeaderFile = "Private/glTFForUE4PrivatePCH.h";

        PrivateIncludePaths.AddRange(new [] {
            "glTFForUE4/Private",
        });

        PublicDependencyModuleNames.AddRange(new [] {
            "Core",
        });

        PrivateDependencyModuleNames.AddRange(new [] {
            "CoreUObject",
            "Engine",
            "Slate",
            "SlateCore",
            "InputCore",
            "AssetRegistry",
        });

        string ExtraPathRoot = System.IO.Path.Combine(ModuleDirectory, "..", "..", "Extras");

        // libgltf
        {
            string glTFPath    = System.IO.Path.Combine(ExtraPathRoot, "libgltf_ue4", "libgltf-0.1.3");
            string IncludePath = System.IO.Path.Combine(glTFPath, "include");
            string LibPath     = "";
            string LibFilePath = "";

            if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
            {
                string PlatformName = "";
                if (Target.Platform == UnrealTargetPlatform.Win32)
                {
                    PlatformName = "win32";
                }
                else if (Target.Platform == UnrealTargetPlatform.Win64)
                {
                    PlatformName = "win64";
                }

                string VSName = "vs" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();

                LibPath = System.IO.Path.Combine(glTFPath, "lib", PlatformName, VSName);

                LibFilePath = System.IO.Path.Combine(LibPath, "libgltf.lib");
            }
            else if (Target.Platform == UnrealTargetPlatform.Linux)
            {
                LibPath = System.IO.Path.Combine(glTFPath, "lib", "linux");

                LibFilePath = System.IO.Path.Combine(LibPath, "libgltf.a");
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                LibPath = System.IO.Path.Combine(glTFPath, "lib", "macos");

                LibFilePath = System.IO.Path.Combine(LibPath, "libgltf.a");
            }
            else if (Target.Platform == UnrealTargetPlatform.IOS)
            {
                LibPath = System.IO.Path.Combine(glTFPath, "lib", "ios");

                LibFilePath = System.IO.Path.Combine(LibPath, "libgltf.a");
            }

            PublicIncludePaths.Add(IncludePath);
            PublicLibraryPaths.Add(LibPath);
            PublicAdditionalLibraries.Add(LibFilePath);
        }

        // libdraco
        {
            string DracoPath    = System.IO.Path.Combine(ExtraPathRoot, "libdraco_ue4", "libdraco-1.2.5");
            string IncludePath  = System.IO.Path.Combine(DracoPath, "include");
            string LibPath      = "";
            string LibFilePath1 = "";
            string LibFilePath2 = "";

            if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
            {
                string PlatformName = "";
                if (Target.Platform == UnrealTargetPlatform.Win32)
                {
                    PlatformName = "win32";
                }
                else if (Target.Platform == UnrealTargetPlatform.Win64)
                {
                    PlatformName = "win64";
                }

                string VSName = "vs" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();

                LibPath = System.IO.Path.Combine(DracoPath, "lib", PlatformName, VSName);

                LibFilePath1 = System.IO.Path.Combine(LibPath, "dracodec.lib");
                LibFilePath2 = System.IO.Path.Combine(LibPath, "dracoenc.lib");
            }
            else if (Target.Platform == UnrealTargetPlatform.Linux)
            {
                LibPath = System.IO.Path.Combine(DracoPath, "lib", "linux");

                LibFilePath1 = System.IO.Path.Combine(LibPath, "libdracodec.a");
                LibFilePath2 = System.IO.Path.Combine(LibPath, "libdracoenc.a");
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                LibPath = System.IO.Path.Combine(DracoPath, "lib", "macos");

                LibFilePath1 = System.IO.Path.Combine(LibPath, "libdracodec.a");
                LibFilePath2 = System.IO.Path.Combine(LibPath, "libdracoenc.a");
            }
            else if (Target.Platform == UnrealTargetPlatform.IOS)
            {
                LibPath = System.IO.Path.Combine(DracoPath, "lib", "ios");

                LibFilePath1 = System.IO.Path.Combine(LibPath, "libdracodec.a");
                LibFilePath2 = System.IO.Path.Combine(LibPath, "libdracoenc.a");
            }

            PublicIncludePaths.Add(IncludePath);
            PublicLibraryPaths.Add(LibPath);
            PublicAdditionalLibraries.Add(LibFilePath1);
            PublicAdditionalLibraries.Add(LibFilePath2);
        }
    }
Пример #13
0
    void OldThirdParty(ReadOnlyTargetRules Target)
    {
        string LibraryPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "ThirdParty", "Library"));

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            string V8LibraryPath = Path.Combine(LibraryPath, "V8", "Win64");

            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "encoding.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "inspector.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "inspector_string_conversions.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "v8_base_without_compiler_0.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "v8_base_without_compiler_1.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "v8_compiler.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "v8_external_snapshot.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "v8_libbase.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "v8_libplatform.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "v8_libsampler.lib"));

            /*
             * if (Target.bBuildEditor)
             * {
             *  string WSLibraryPath = Path.Combine(LibraryPath, "Websockets", "Win64");
             *
             *  PublicAdditionalLibraries.Add(Path.Combine(WSLibraryPath, "websockets_static.lib"));
             *  PublicAdditionalLibraries.Add(Path.Combine(WSLibraryPath, "libssl_static.lib"));
             *  PublicAdditionalLibraries.Add(Path.Combine(WSLibraryPath, "libcrypto_static.lib"));
             *  PublicAdditionalLibraries.Add(Path.Combine(WSLibraryPath, "zlib_internal.lib"));
             * }
             */
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            if (Target.Version.MajorVersion == 4 && Target.Version.MinorVersion >= 25)
            {
                // for arm7
                string V8LibraryPath = Path.Combine(LibraryPath, "V8", "Android", "armeabi-v7a", "8.4.371.19");
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libwee8.a"));
                // for arm64
                V8LibraryPath = Path.Combine(LibraryPath, "V8", "Android", "arm64-v8a", "8.4.371.19");
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libwee8.a"));
            }
            else if (Target.Version.MajorVersion == 4 && Target.Version.MinorVersion < 25 && Target.Version.MinorVersion >= 22)
            {
                // for arm7
                string V8LibraryPath = Path.Combine(LibraryPath, "V8", "Android", "armeabi-v7a", "7.4.288");
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libinspector.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_base.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_external_snapshot.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libbase.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libplatform.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libsampler.a"));
                // for arm64
                V8LibraryPath = Path.Combine(LibraryPath, "V8", "Android", "arm64-v8a", "7.4.288");
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libinspector.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_base.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_external_snapshot.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libbase.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libplatform.a"));
                PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libsampler.a"));
            }
            else if (Target.Version.MajorVersion == 4 && Target.Version.MinorVersion < 22)
            {
                string V8LibraryPath = Path.Combine(LibraryPath, "V8", "Android", "armeabi-v7a", "7.4.288");
                PublicLibraryPaths.Add(V8LibraryPath);
                V8LibraryPath = Path.Combine(LibraryPath, "V8", "Android", "arm64-v8a", "7.4.288");
                PublicLibraryPaths.Add(V8LibraryPath);
                PublicAdditionalLibraries.Add("inspector");
                PublicAdditionalLibraries.Add("v8_base");
                PublicAdditionalLibraries.Add("v8_external_snapshot");
                PublicAdditionalLibraries.Add("v8_libbase");
                PublicAdditionalLibraries.Add("v8_libplatform");
                PublicAdditionalLibraries.Add("v8_libsampler");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            // PublicFrameworks.AddRange(new string[] { "WebKit",  "JavaScriptCore" });
            PublicFrameworks.AddRange(new string[] { "WebKit" });
            string V8LibraryPath = Path.Combine(LibraryPath, "V8", "macOS");
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libbindings.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libencoding.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libinspector.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libinspector_string_conversions.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libtorque_base.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libtorque_generated_definitions.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libtorque_generated_initializers.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_base_without_compiler.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_compiler.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_external_snapshot.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_init.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_initializers.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libbase.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libplatform.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libsampler.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_nosnapshot.a"));

            //PublicAdditionalLibraries.Add(Path.Combine(Path.Combine(LibraryPath, "ffi", "macOS"), "libffi.a"));
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicFrameworks.AddRange(new string[] { "WebKit" });
            string V8LibraryPath = Path.Combine(LibraryPath, "V8", "iOS", "arm64");
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libbindings.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libencoding.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libinspector.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libinspector_string_conversions.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libtorque_generated_definitions.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_base_without_compiler.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_compiler.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_external_snapshot.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libbase.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libplatform.a"));
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libv8_libsampler.a"));

            //PublicAdditionalLibraries.Add(Path.Combine(Path.Combine(LibraryPath, "ffi", "iOS"), "libffi.a"));
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            string V8LibraryPath = Path.Combine(LibraryPath, "V8", "Linux");
            PublicAdditionalLibraries.Add(Path.Combine(V8LibraryPath, "libwee8.a"));
        }

        string HeaderPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "ThirdParty", "Include"));

        // External headers
        if (Target.Platform == UnrealTargetPlatform.Android)
        {
            if (Target.Version.MajorVersion == 4 && Target.Version.MinorVersion >= 25)
            {
                PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "v8", "8.4.371.19") });
            }
            else if (Target.Version.MajorVersion == 4 && Target.Version.MinorVersion < 25)
            {
                PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "v8", "7.4.288") });
            }
            PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "websocketpp") });
            PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "asio") });
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64 ||
                 Target.Platform == UnrealTargetPlatform.IOS ||
                 Target.Platform == UnrealTargetPlatform.Mac ||
                 Target.Platform == UnrealTargetPlatform.Linux)
        {
            PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "v8", "7.7.299") });
            PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "websocketpp") });
            PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "asio") });
        }
    }
    public GameLiftServerSDK(ReadOnlyTargetRules Target) : base(Target)
    {
        PublicIncludePaths.AddRange(
            new string[] {
            "GameLiftServerSDK/Public",
        });


        PrivateIncludePaths.AddRange(
            new string[] {
            "GameLiftServerSDK/Private",
        });


        PublicDependencyModuleNames.AddRange(
            new string[] {
            "Core",
            "Projects",
        });


        PrivateDependencyModuleNames.AddRange(
            new string[] {
        });


        DynamicallyLoadedModuleNames.AddRange(
            new string[] {
        });

        string BaseDirectory = System.IO.Path.GetFullPath(System.IO.Path.Combine(ModuleDirectory, "..", ".."));
        string SDKDirectory  = System.IO.Path.Combine(BaseDirectory, "ThirdParty", "GameLiftServerSDK", Target.Platform.ToString());

        bool bHasGameLiftSDK = System.IO.Directory.Exists(SDKDirectory);

        if (bHasGameLiftSDK)
        {
            if (Target.Type == TargetRules.TargetType.Server)
            {
                // Suppress build error 4577
                bEnableExceptions = true;

                PublicDefinitions.Add("WITH_GAMELIFT=1");

                if (Target.Platform == UnrealTargetPlatform.Linux)
                {
                    SDKDirectory = System.IO.Path.Combine(SDKDirectory, "x86_64-unknown-linux-gnu");
                    string SDKLib = System.IO.Path.Combine(SDKDirectory, "libaws-cpp-sdk-gamelift-server.so");

                    PublicLibraryPaths.Add(SDKDirectory);
                    PublicAdditionalLibraries.Add(SDKLib);
                    RuntimeDependencies.Add(SDKLib);
                }
                else if (Target.Platform == UnrealTargetPlatform.Win64)
                {
                    PublicLibraryPaths.Add(SDKDirectory);
                    PublicAdditionalLibraries.Add(System.IO.Path.Combine(SDKDirectory, "aws-cpp-sdk-gamelift-server.lib"));
                    PublicDelayLoadDLLs.Add("aws-cpp-sdk-gamelift-server.dll");
                    string SDKLibWindows = System.IO.Path.Combine(SDKDirectory, "aws-cpp-sdk-gamelift-server.dll");
                    RuntimeDependencies.Add(SDKLibWindows);
                }
            }
            else
            {
                PublicDefinitions.Add("WITH_GAMELIFT=0");
            }
        }
        else
        {
            PublicDefinitions.Add("WITH_GAMELIFT=0");
        }
    }
    public Python(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        var EngineDir    = Path.GetFullPath(Target.RelativeEnginePath);
        var PythonTPSDir = Path.Combine(EngineDir, "Source", "ThirdParty", "Python");

        string PythonRoot        = null;
        string PythonIncludePath = null;
        string PythonLibPath     = null;
        string PythonLibName     = null;

        if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux)
        {
            // Check for an explicit version before using the auto-detection logic
            PythonRoot = System.Environment.GetEnvironmentVariable("UE_PYTHON_DIR");
        }

        // Perform auto-detection to try and find the Python root
        if (PythonRoot == null)
        {
            var KnownPaths = new List <string>();

            // todo: This isn't correct for cross-compilation, we need to consider the host platform too
            if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
            {
                KnownPaths.AddRange(
                    new string[] {
                    Path.Combine(PythonTPSDir, Target.Platform == UnrealTargetPlatform.Win32 ? "Win32" : "Win64"),
                    //"C:/Program Files/Python36",
                    "C:/Python27",
                }
                    );
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                KnownPaths.AddRange(
                    new string[] {
                    Path.Combine(PythonTPSDir, "Mac"),
                    //"/Library/Frameworks/Python.framework/Versions/3.6",
                    "/Library/Frameworks/Python.framework/Versions/2.7",
                    //"/System/Library/Frameworks/Python.framework/Versions/2.7",
                }
                    );
            }

            foreach (var KnownPath in KnownPaths)
            {
                if (Directory.Exists(KnownPath))
                {
                    PythonRoot = KnownPath;
                    break;
                }
            }
        }

        // Work out the include path
        if (PythonRoot != null)
        {
            PythonIncludePath = Path.Combine(PythonRoot, "include");
            if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                // On Mac the actual headers are inside a "pythonxy" directory, where x and y are the version number
                if (Directory.Exists(PythonIncludePath))
                {
                    string[] MatchingIncludePaths = Directory.GetDirectories(PythonIncludePath, "python*");
                    if (MatchingIncludePaths.Length > 0)
                    {
                        PythonIncludePath = Path.Combine(PythonIncludePath, Path.GetFileName(MatchingIncludePaths[0]));
                    }
                }
            }
            if (!Directory.Exists(PythonIncludePath))
            {
                PythonRoot = null;
            }
        }

        // Work out the lib path
        if (PythonRoot != null)
        {
            string LibFolder      = null;
            string LibNamePattern = null;
            switch (Target.Platform)
            {
            case UnrealTargetPlatform.Win32:
            case UnrealTargetPlatform.Win64:
                LibFolder      = "libs";
                LibNamePattern = "python*.lib";
                break;

            case UnrealTargetPlatform.Mac:
                LibFolder      = "lib";
                LibNamePattern = "libpython*.dylib";
                break;

            case UnrealTargetPlatform.Linux:
                LibFolder      = "lib";
                LibNamePattern = "libpython*.so";
                break;

            default:
                break;
            }

            if (LibFolder != null && LibNamePattern != null)
            {
                PythonLibPath = Path.Combine(PythonRoot, LibFolder);

                if (Directory.Exists(PythonLibPath))
                {
                    string[] MatchingLibFiles = Directory.GetFiles(PythonLibPath, LibNamePattern);
                    if (MatchingLibFiles.Length > 0)
                    {
                        PythonLibName = Path.GetFileName(MatchingLibFiles[0]);
                    }
                }
            }

            if (PythonLibPath == null || PythonLibName == null)
            {
                PythonRoot = null;
            }
        }

        // Make sure the Python install is the correct architecture
        if (PythonRoot != null)
        {
            string ExpectedPointerSizeResult = Target.Platform == UnrealTargetPlatform.Win32 ? "4" : "8";

            // Invoke Python to query the pointer size of the interpreter so we can work out whether it's 32-bit or 64-bit
            // todo: We probably need to do this for all platforms, but right now it's only an issue on Windows
            if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
            {
                string Result = InvokePython(PythonRoot, "-c \"import struct; print(struct.calcsize('P'))\"");
                Result = Result != null?Result.Replace("\r", "").Replace("\n", "") : null;

                if (Result == null || Result != ExpectedPointerSizeResult)
                {
                    PythonRoot = null;
                }
            }
        }

        if (PythonRoot == null)
        {
            PublicDefinitions.Add("WITH_PYTHON=0");
        }
        else
        {
            // If the Python install we're using is within the Engine directory, make the path relative so that it's portable
            string EngineRelativePythonRoot = PythonRoot;
            if (EngineRelativePythonRoot.StartsWith(EngineDir))
            {
                // Strip the Engine directory and then combine the path with the placeholder to ensure the path is delimited correctly
                EngineRelativePythonRoot = EngineRelativePythonRoot.Remove(0, EngineDir.Length);
                RuntimeDependencies.Add(Path.Combine("$(EngineDir)", EngineRelativePythonRoot, "..."));            // Stage the Python SDK for use at runtime
                EngineRelativePythonRoot = Path.Combine("{ENGINE_DIR}", EngineRelativePythonRoot);                 // Can't use $(EngineDir) as the placeholder here as UBT is eating it
            }

            PublicDefinitions.Add("WITH_PYTHON=1");
            PublicDefinitions.Add(string.Format("UE_PYTHON_DIR=\"{0}\"", EngineRelativePythonRoot.Replace('\\', '/')));

            // Some versions of Python need this define set when building on MSVC
            if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
            {
                PublicDefinitions.Add("HAVE_ROUND=1");
            }

            PublicSystemIncludePaths.Add(PythonIncludePath);
            if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                // Mac doesn't understand PublicLibraryPaths
                PublicAdditionalLibraries.Add(Path.Combine(PythonLibPath, PythonLibName));
            }
            else
            {
                PublicLibraryPaths.Add(PythonLibPath);
                PublicAdditionalLibraries.Add(PythonLibName);
            }
        }
    }
    public ApexDestructionLib(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        if (Target.bCompileAPEX == false)
        {
            return;
        }
        
        // Determine which kind of libraries to link against
        APEXLibraryMode LibraryMode = GetAPEXLibraryMode(Target.Configuration);
        string LibrarySuffix = GetAPEXLibrarySuffix(LibraryMode);

        string ApexVersion = "APEX_1.4";

        string APEXDir = Target.UEThirdPartySourceDirectory + "PhysX3/" + ApexVersion + "/";

        string APEXLibDir = Target.UEThirdPartySourceDirectory + "PhysX3/Lib";

        PublicSystemIncludePaths.AddRange(
            new string[] {
                APEXDir + "include/destructible",
            }
            );

        // List of default library names (unused unless LibraryFormatString is non-null)
        List<string> ApexLibraries = new List<string>();
        ApexLibraries.AddRange(
            new string[]
            {
                "APEX_Destructible{0}",
            });
        string LibraryFormatString = null;
        

        // Libraries and DLLs for windows platform
        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            APEXLibDir += "/Win64/VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(APEXLibDir);

            PublicAdditionalLibraries.Add(String.Format("APEXFramework{0}_x64.lib", LibrarySuffix));
            PublicDelayLoadDLLs.Add(String.Format("APEXFramework{0}_x64.dll", LibrarySuffix));

            string[] RuntimeDependenciesX64 =
            {
                "APEX_Destructible{0}_x64.dll",
            };

            string ApexBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX3/Win64/VS{0}/", Target.WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string RuntimeDependency in RuntimeDependenciesX64)
            {
                string FileName = ApexBinariesDir + String.Format(RuntimeDependency, LibrarySuffix);
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }

        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            APEXLibDir += "/Win32/VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(APEXLibDir);

            PublicAdditionalLibraries.Add(String.Format("APEXFramework{0}_x86.lib", LibrarySuffix));
            PublicDelayLoadDLLs.Add(String.Format("APEXFramework{0}_x86.dll", LibrarySuffix));

            string[] RuntimeDependenciesX86 =
            {
                "APEX_Destructible{0}_x86.dll",
            };

            string ApexBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX3/Win32/VS{0}/", Target.WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string RuntimeDependency in RuntimeDependenciesX86)
            {
                string FileName = ApexBinariesDir + String.Format(RuntimeDependency, LibrarySuffix);
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            APEXLibDir += "/Mac";

            string[] DynamicLibrariesMac = new string[] {
                "/libAPEX_Destructible{0}.dylib"
            };

            string PhysXBinariesDir = Target.UEThirdPartyBinariesDirectory + "PhysX3/Mac";
            foreach (string Lib in DynamicLibrariesMac)
            {
                string LibraryPath = PhysXBinariesDir + String.Format(Lib, LibrarySuffix);
                PublicDelayLoadDLLs.Add(LibraryPath);
                RuntimeDependencies.Add(new RuntimeDependency(LibraryPath));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.Architecture.StartsWith("x86_64"))
            {
                APEXLibDir += "/Linux/" + Target.Architecture;
                ApexLibraries.Add("APEX_Destructible{0}");
                LibraryFormatString = APEXLibDir + "/lib{0}" + ".a";
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            APEXLibDir += "/PS4";
            PublicLibraryPaths.Add(APEXLibDir);

            LibraryFormatString = "{0}";
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            APEXLibDir += "/XboxOne/VS2015";
            PublicLibraryPaths.Add(APEXLibDir);

            LibraryFormatString = "{0}.lib";
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            APEXLibDir += "/Switch";
            PublicLibraryPaths.Add(APEXLibDir);

            LibraryFormatString = "{0}";
        }

        // Add the libraries needed (used for all platforms except Windows and Mac)
        if (LibraryFormatString != null)
        {
            foreach (string Lib in ApexLibraries)
            {
                string ConfiguredLib = String.Format(Lib, LibrarySuffix);
                string FinalLib = String.Format(LibraryFormatString, ConfiguredLib);
                PublicAdditionalLibraries.Add(FinalLib);
            }
        }
    }
Пример #17
0
        public SQLiteSupport(ReadOnlyTargetRules Target) : base(Target)
        {
            string PlatformName      = "";
            string ConfigurationName = "";

            switch (Target.Platform)
            {
            case UnrealTargetPlatform.Win32:
                PlatformName = "Win32/";
                break;

            case UnrealTargetPlatform.Win64:
                PlatformName = "x64/";
                break;

            case UnrealTargetPlatform.IOS:
            case UnrealTargetPlatform.TVOS:
                PlatformName = "IOS/";
                break;

            case UnrealTargetPlatform.Mac:
                PlatformName = "Mac/";
                break;

            case UnrealTargetPlatform.Linux:
                PlatformName = "Linux/";
                break;
            }

            switch (Target.Configuration)
            {
            case UnrealTargetConfiguration.Debug:
                ConfigurationName = "Debug/";
                break;

            case UnrealTargetConfiguration.DebugGame:
                ConfigurationName = "Debug/";
                break;

            default:
                ConfigurationName = "Release/";
                break;
            }

            string LibraryPath = "" + Target.UEThirdPartySourceDirectory + "sqlite/lib/" + PlatformName + ConfigurationName;

            string LibraryFilename;

            if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.XboxOne)
            {
                LibraryFilename = Path.Combine(LibraryPath, "sqlite.lib");
            }
            else
            {
                LibraryFilename = Path.Combine(LibraryPath, "sqlite.a");
            }

            if (!File.Exists(LibraryFilename))
            {
                throw new BuildException("Please refer to the Engine/Source/ThirdParty/sqlite/README.txt file prior to enabling this module.");
            }

            PublicIncludePaths.Add(Target.UEThirdPartySourceDirectory + "sqlite/sqlite/");

            PublicDependencyModuleNames.AddRange(
                new string[] {
                "Core",
                "DatabaseSupport",
            }
                );

            // Lib file
            PublicLibraryPaths.Add(LibraryPath);
            PublicAdditionalLibraries.Add(LibraryFilename);
        }
    public Steamworks(TargetInfo Target)
    {
        /** Mark the current version of the Steam SDK */
        string SteamVersion = "v132";

        Type = ModuleType.External;

        string SdkBase = UEBuildConfiguration.UEThirdPartySourceDirectory + "Steamworks/Steam" + SteamVersion + "/sdk";

        if (!Directory.Exists(SdkBase))
        {
            string Err = string.Format("steamworks SDK not found in {0}", SdkBase);
            System.Console.WriteLine(Err);
            throw new BuildException(Err);
        }

        PublicIncludePaths.Add(SdkBase + "/public");

        string LibraryPath = SdkBase + "/redistributable_bin/";
        string LibraryName = "steam_api";

        if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            PublicLibraryPaths.Add(LibraryPath);
            PublicAdditionalLibraries.Add(LibraryName + ".lib");
            PublicDelayLoadDLLs.Add(LibraryName + ".dll");

            string SteamBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/Steamworks/Steam{0}/Win32/", SteamVersion);
            RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "steam_api.dll"));

            if (Target.Type == TargetRules.TargetType.Server)
            {
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "steamclient.dll"));
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "tier0_s.dll"));
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "vstdlib_s.dll"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicLibraryPaths.Add(LibraryPath + "win64");
            PublicAdditionalLibraries.Add(LibraryName + "64.lib");
            PublicDelayLoadDLLs.Add(LibraryName + "64.dll");

            string SteamBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/Steamworks/Steam{0}/Win64/", SteamVersion);
            RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + LibraryName + "64.dll"));

            if (Target.Type == TargetRules.TargetType.Server)
            {
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "steamclient64.dll"));
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "tier0_s64.dll"));
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "vstdlib_s64.dll"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            LibraryPath += "osx32/libsteam_api.dylib";
            PublicDelayLoadDLLs.Add(LibraryPath);
            PublicAdditionalShadowFiles.Add(LibraryPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.IsMonolithic)
            {
                LibraryPath += "linux64";
                PublicLibraryPaths.Add(LibraryPath);
                PublicAdditionalLibraries.Add(LibraryName);
            }
            else
            {
                LibraryPath += "linux64/libsteam_api.so";
                PublicDelayLoadDLLs.Add(LibraryPath);
            }
        }
    }
Пример #19
0
    public libcurl(TargetInfo Target)
    {
        Type = ModuleType.External;

        Definitions.Add("WITH_LIBCURL=1");

        string NewLibCurlPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "libcurl/7_48_0/";
        string LibCurlPath    = UEBuildConfiguration.UEThirdPartySourceDirectory + "libcurl/curl-7.47.1/";

        // TODO: latest recompile for consoles and mobile platforms
        string OldLibCurlPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "libcurl/";

        if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            string platform    = "/Linux/" + Target.Architecture;
            string IncludePath = NewLibCurlPath + "include" + platform;
            string LibraryPath = NewLibCurlPath + "lib" + platform;

            PublicIncludePaths.Add(IncludePath);
            PublicLibraryPaths.Add(LibraryPath);
            PublicAdditionalLibraries.Add(LibraryPath + "/libcurl.a");

            PrivateDependencyModuleNames.Add("SSL");
        }

        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            // toolchain will filter properly
            PublicIncludePaths.Add(OldLibCurlPath + "include/Android/ARMv7");
            PublicLibraryPaths.Add(OldLibCurlPath + "lib/Android/ARMv7");
            PublicIncludePaths.Add(OldLibCurlPath + "include/Android/ARM64");
            PublicLibraryPaths.Add(OldLibCurlPath + "lib/Android/ARM64");
            PublicIncludePaths.Add(OldLibCurlPath + "include/Android/x86");
            PublicLibraryPaths.Add(OldLibCurlPath + "lib/Android/x86");
            PublicIncludePaths.Add(OldLibCurlPath + "include/Android/x64");
            PublicLibraryPaths.Add(OldLibCurlPath + "lib/Android/x64");

            PublicAdditionalLibraries.Add("curl");
//            PublicAdditionalLibraries.Add("crypto");
//            PublicAdditionalLibraries.Add("ssl");
//            PublicAdditionalLibraries.Add("dl");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string PlatformSubdir = "/Mac/";
            PublicIncludePaths.Add(LibCurlPath + "include" + PlatformSubdir);
            // OSX needs full path
            PublicAdditionalLibraries.Add(LibCurlPath + "lib" + PlatformSubdir + "libcurl.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64 ||
                 (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32"))
        {
            string PlatformSubdir = (Target.Platform == UnrealTargetPlatform.HTML5) ? "Win32" : Target.Platform.ToString();

            PublicIncludePaths.Add(LibCurlPath + "/include/" + PlatformSubdir + "/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName());
            PublicLibraryPaths.Add(LibCurlPath + "/lib/" + PlatformSubdir + "/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName());

            PublicAdditionalLibraries.Add("libcurl_a.lib");
            Definitions.Add("CURL_STATICLIB=1");
        }
    }
    public AWSCore(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivateIncludePaths.AddRange(new string[] { "GameLiftClientSDK/AWSCore/Private" });
        PublicIncludePaths.AddRange(new string[] { "GameLiftClientSDK/AWSCore/Public" });

        PublicDependencyModuleNames.AddRange(new string[] { "Engine", "Core", "CoreUObject", "InputCore", "Projects" });
        PrivateDependencyModuleNames.AddRange(new string[] { });

        string BaseDirectory          = System.IO.Path.GetFullPath(System.IO.Path.Combine(ModuleDirectory, "..", "..", ".."));
        string ThirdPartyPath         = System.IO.Path.Combine(BaseDirectory, "ThirdParty", "GameLiftClientSDK", Target.Platform.ToString());
        bool   bIsThirdPartyPathValid = System.IO.Directory.Exists(ThirdPartyPath);

        if (bIsThirdPartyPathValid)
        {
            PublicLibraryPaths.Add(ThirdPartyPath);

            //string AWSCCommonLibFile = System.IO.Path.Combine(ThirdPartyPath, "aws-c-common.lib");
            //if (File.Exists(AWSCCommonLibFile))
            //{
            //    PublicAdditionalLibraries.Add(AWSCCommonLibFile);
            //}
            //else
            //{
            //    throw new BuildException("aws-c-common.lib not found. Expected in this location: " + AWSCCommonLibFile);
            //}

            //string AWSCCommonDLLFile = System.IO.Path.Combine(ThirdPartyPath, "aws-c-common.dll");
            //if (File.Exists(AWSCCommonDLLFile))
            //{
            //    PublicAdditionalLibraries.Add(AWSCCommonDLLFile);
            //}
            //else
            //{
            //    throw new BuildException("aws-c-common.dll not found. Expected in this location: " + AWSCCommonDLLFile);
            //}

            //string AWSCEventStreamLibFile = System.IO.Path.Combine(ThirdPartyPath, "aws-c-event-stream.lib");
            //if (File.Exists(AWSCEventStreamLibFile))
            //{
            //    PublicAdditionalLibraries.Add(AWSCEventStreamLibFile);
            //}
            //else
            //{
            //    throw new BuildException("aws-c-event-stream.lib not found. Expected in this location: " + AWSCEventStreamLibFile);
            //}

            //string AWSCEventStreamDLLFile = System.IO.Path.Combine(ThirdPartyPath, "aws-c-event-stream.dll");
            //if (File.Exists(AWSCEventStreamDLLFile))
            //{
            //    PublicAdditionalLibraries.Add(AWSCEventStreamDLLFile);
            //}
            //else
            //{
            //    throw new BuildException("aws-c-event-stream.dll not found. Expected in this location: " + AWSCEventStreamDLLFile);
            //}

            string AWSCoreLibFile = System.IO.Path.Combine(ThirdPartyPath, "aws-cpp-sdk-core.lib");
            if (File.Exists(AWSCoreLibFile))
            {
                PublicAdditionalLibraries.Add(AWSCoreLibFile);
            }
            else
            {
                throw new BuildException("aws-cpp-sdk-core.lib not found. Expected in this location: " + AWSCoreLibFile);
            }

            string AWSCoreDLLFile     = System.IO.Path.Combine(ThirdPartyPath, "aws-cpp-sdk-core.dll");
            string AWSCommonDLLFile   = System.IO.Path.Combine(ThirdPartyPath, "aws-c-common.dll");
            string AWSStreamDLLFile   = System.IO.Path.Combine(ThirdPartyPath, "aws-c-event-stream.dll");
            string AWSChecksumDLLFile = System.IO.Path.Combine(ThirdPartyPath, "aws-checksums.dll");

            if (File.Exists(AWSCoreDLLFile))
            {
                RuntimeDependencies.Add(AWSCommonDLLFile);
                RuntimeDependencies.Add(AWSStreamDLLFile);
                RuntimeDependencies.Add(AWSChecksumDLLFile);

                PublicDelayLoadDLLs.Add("aws-cpp-sdk-core.dll");
                RuntimeDependencies.Add(AWSCoreDLLFile);
            }
            else
            {
                throw new BuildException("aws-cpp-sdk-core.dll not found. Expected in this location: " + AWSCoreDLLFile);
            }

            string BinariesDirectory = System.IO.Path.Combine(BaseDirectory, "Binaries", Target.Platform.ToString());
            if (!Directory.Exists(BinariesDirectory))
            {
                Directory.CreateDirectory(BinariesDirectory);
            }

            if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "aws-cpp-sdk-core.dll")) == false)
            {
                File.Copy(System.IO.Path.Combine(ThirdPartyPath, "aws-cpp-sdk-core.dll"), System.IO.Path.Combine(BinariesDirectory, "aws-cpp-sdk-core.dll"));
            }

            if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "aws-c-common.dll")) == false)
            {
                File.Copy(System.IO.Path.Combine(ThirdPartyPath, "aws-c-common.dll"), System.IO.Path.Combine(BinariesDirectory, "aws-c-common.dll"));
            }

            if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "aws-c-event-stream.dll")) == false)
            {
                File.Copy(System.IO.Path.Combine(ThirdPartyPath, "aws-c-event-stream.dll"), System.IO.Path.Combine(BinariesDirectory, "aws-c-event-stream.dll"));
            }

            if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "aws-checksums.dll")) == false)
            {
                File.Copy(System.IO.Path.Combine(ThirdPartyPath, "aws-checksums.dll"), System.IO.Path.Combine(BinariesDirectory, "aws-checksums.dll"));
            }
        }
    }
Пример #21
0
        public SQLiteSupport(TargetInfo Target)
        {
            string PlatformName      = "";
            string ConfigurationName = "";

            switch (Target.Platform)
            {
            case UnrealTargetPlatform.Win32:
                PlatformName = "Win32/";
                break;

            case UnrealTargetPlatform.Win64:
                PlatformName = "x64/";
                break;

            case UnrealTargetPlatform.IOS:
                PlatformName = "IOS/";
                break;

            case UnrealTargetPlatform.Mac:
                PlatformName = "Mac/";
                break;

            case UnrealTargetPlatform.Linux:
                PlatformName = "Linux/";
                break;
            }

            switch (Target.Configuration)
            {
            case UnrealTargetConfiguration.Debug:
                ConfigurationName = "Debug/";
                break;

            case UnrealTargetConfiguration.DebugGame:
                ConfigurationName = "Debug/";
                break;

            default:
                ConfigurationName = "Release/";
                break;
            }

            string LibraryPath     = "" + UEBuildConfiguration.UEThirdPartySourceDirectory + "sqlite/lib/" + PlatformName + ConfigurationName;
            string LibraryFilename = Path.Combine(LibraryPath, "sqlite" + UEBuildPlatform.GetBuildPlatform(Target.Platform).GetBinaryExtension(UEBuildBinaryType.StaticLibrary));

            if (!File.Exists(LibraryFilename))
            {
                throw new BuildException("Please refer to the Engine/Source/ThirdParty/sqlite/README.txt file prior to enabling this module.");
            }

            PublicIncludePaths.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "sqlite/sqlite/");

            PublicDependencyModuleNames.AddRange(
                new string[] {
                "Core",
                "DatabaseSupport",
            }
                );

            // Lib file
            PublicLibraryPaths.Add(LibraryPath);
            PublicAdditionalLibraries.Add(LibraryFilename);
        }
Пример #22
0
    public void LoadZEDSDK(ReadOnlyTargetRules Target, string DirPath)
    {
        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            if (!Directory.Exists(DirPath))
            {
                string Err = string.Format("ZED SDK missing");
                System.Console.WriteLine(Err);
                throw new BuildException(Err);
            }

            // Check SDK version
            string DefinesHeaderFilePath = Path.Combine(DirPath, "include\\sl_zed\\defines.hpp");
            string Major = "2";
            string Minor = "7";

            // Find SDK major and minor version and compare
            foreach (var line in File.ReadLines(DefinesHeaderFilePath))
            {
                if (!string.IsNullOrEmpty(line))
                {
                    if (line.Contains("#define ZED_SDK_MAJOR_VERSION"))
                    {
                        string SDKMajor = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)[2];
                        if (!SDKMajor.Equals(Major))
                        {
                            string Err = string.Format("ZED SDK Major Version mismatch : found {0} expected {1}", SDKMajor, Major);
                            System.Console.WriteLine(Err);
                            throw new BuildException(Err);
                        }
                    }
                    else if (line.Contains("#define ZED_SDK_MINOR_VERSION"))
                    {
                        string SDKMinor = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)[2];
                        if (!SDKMinor.Equals(Minor))
                        {
                            string Err = string.Format("ZED SDK Minor Version mismatch : found {0} expected {1}", SDKMinor, Minor);
                            System.Console.WriteLine(Err);
                            throw new BuildException(Err);
                        }

                        break;
                    }
                }
            }

            // Set the paths to the SDK
            string[] LibrariesNames = Directory.GetFiles(Path.Combine(DirPath, "lib"));

            PublicIncludePaths.Add(Path.Combine(DirPath, "include"));
            PublicLibraryPaths.Add(Path.Combine(DirPath, "lib"));

            foreach (string Library in LibrariesNames)
            {
                PublicAdditionalLibraries.Add(Library);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            string Err = string.Format("Attempt to build against ZED SDK on unsupported platform {0}", Target.Platform);
            System.Console.WriteLine(Err);
            throw new BuildException(Err);
        }
    }
Пример #23
0
    private bool LoadV8(ReadOnlyTargetRules Target)
    {
        int[] v8_version            = GetV8Version();
        bool  ShouldLink_libsampler = !(v8_version[0] == 5 && v8_version[1] < 3);

        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
        {
            string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib");

            if (Target.Platform == UnrealTargetPlatform.Win64)
            {
                LibrariesPath = Path.Combine(LibrariesPath, "Win64");
            }
            else
            {
                LibrariesPath = Path.Combine(LibrariesPath, "Win32");
            }

            if (Target.Configuration == UnrealTargetConfiguration.Debug)
            {
                LibrariesPath = Path.Combine(LibrariesPath, "Debug");
            }
            else
            {
                LibrariesPath = Path.Combine(LibrariesPath, "Release");
            }

            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "v8_base_0.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "v8_base_1.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "v8_base_2.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "v8_base_3.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "v8_libbase.lib"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "v8_libplatform.lib"));

            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "v8_nosnapshot.lib"));

            if (ShouldLink_libsampler)
            {
                PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "v8_libsampler.lib"));
            }


            Definitions.Add(string.Format("WITH_V8=1"));

            return(true);
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Android");
            PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "ARMv7"));
            PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "ARM64"));
            PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "x86"));
            PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "x64"));

            PublicAdditionalLibraries.Add("v8_base");
            PublicAdditionalLibraries.Add("v8_libbase");
            PublicAdditionalLibraries.Add("v8_libplatform");
            PublicAdditionalLibraries.Add("v8_nosnapshot");

            if (ShouldLink_libsampler)
            {
                PublicAdditionalLibraries.Add("v8_libsampler");
            }

            Definitions.Add(string.Format("WITH_V8=1"));

            return(true);
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Linux");
            PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "x64"));

            PublicAdditionalLibraries.Add("v8_base");
            PublicAdditionalLibraries.Add("v8_libbase");
            PublicAdditionalLibraries.Add("v8_libplatform");
            PublicAdditionalLibraries.Add("v8_nosnapshot");

            if (ShouldLink_libsampler)
            {
                PublicAdditionalLibraries.Add("v8_libsampler");
            }

            Definitions.Add(string.Format("WITH_V8=1"));

            return(true);
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Mac", "x64");
            PublicLibraryPaths.Add(LibrariesPath);

            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_base.a"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libbase.a"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libplatform.a"));
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_nosnapshot.a"));

            if (ShouldLink_libsampler)
            {
                PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libsampler.a"));
            }

            Definitions.Add(string.Format("WITH_V8=1"));

            return(true);
        }
        Definitions.Add(string.Format("WITH_V8=0"));
        return(false);
    }
    public zlib(TargetInfo Target)
    {
        Type = ModuleType.External;

        string zlibPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "zlib/zlib-1.2.5/";

        PublicIncludePaths.Add(zlibPath + "Inc");

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicLibraryPaths.Add(zlibPath + "Lib/Win64");
            PublicAdditionalLibraries.Add("zlib_64.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32 ||
                 (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32") // simulator
                 )
        {
            PublicLibraryPaths.Add(zlibPath + "Lib/Win32");
            PublicAdditionalLibraries.Add("zlib.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac ||
                 Target.Platform == UnrealTargetPlatform.IOS ||
                 Target.Platform == UnrealTargetPlatform.TVOS)
        {
            PublicAdditionalLibraries.Add("z");
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicAdditionalLibraries.Add("z");
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            string OpimizationSuffix = "";
            if (UEBuildConfiguration.bCompileForSize)
            {
                OpimizationSuffix = "_Oz";
            }
            else
            {
                if (Target.Configuration == UnrealTargetConfiguration.Development)
                {
                    OpimizationSuffix = "_O2";
                }
                else if (Target.Configuration == UnrealTargetConfiguration.Shipping)
                {
                    OpimizationSuffix = "_O3";
                }
            }
            PublicAdditionalLibraries.Add(zlibPath + "Lib/HTML5/zlib" + OpimizationSuffix + ".bc");
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.IsMonolithic)
            {
                PublicAdditionalLibraries.Add(zlibPath + "Lib/Linux/" + Target.Architecture + "/libz.a");
            }
            else
            {
                PublicAdditionalLibraries.Add(zlibPath + "Lib/Linux/" + Target.Architecture + "/libz_fPIC.a");
            }
        }
    }
Пример #25
0
    public VulkanRHI(ReadOnlyTargetRules Target) : base(Target)
    {
        bOutputPubliclyDistributable = true;

        PrivateIncludePaths.Add("Runtime/Vulkan/Private");

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "CoreUObject",
            "Engine",
            "RHI",
            "RenderCore",
            "ShaderCore",
            "UtilityShaders",
        }
            );

        if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
        {
            string VulkanSDKPath  = Environment.GetEnvironmentVariable("VULKAN_SDK");
            bool   bSDKInstalled  = !String.IsNullOrEmpty(VulkanSDKPath);
            bool   bUseThirdParty = true;
            if (bSDKInstalled)
            {
                // Check if the installed SDK is newer or the same than the provided headers distributed with the Engine
                int ThirdPartyVersion = GetThirdPartyVersion();
                int SDKVersion        = GetSDKVersion(VulkanSDKPath);
                if (SDKVersion >= ThirdPartyVersion)
                {
                    // If the user has an installed SDK, use that instead
                    PrivateIncludePaths.Add(VulkanSDKPath + "/Include");
                    // Older SDKs have an extra subfolder
                    PrivateIncludePaths.Add(VulkanSDKPath + "/Include/vulkan");

                    if (Target.Platform == UnrealTargetPlatform.Win32)
                    {
                        PublicLibraryPaths.Add(VulkanSDKPath + "/Source/lib32");
                    }
                    else
                    {
                        PublicLibraryPaths.Add(VulkanSDKPath + "/Source/lib");
                    }

                    PublicAdditionalLibraries.Add("vulkan-1.lib");
                    PublicAdditionalLibraries.Add("vkstatic.1.lib");
                    bUseThirdParty = false;
                }
            }
            if (bUseThirdParty)
            {
                AddEngineThirdPartyPrivateStaticDependencies(Target, "Vulkan");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "SDL2");

            string VulkanSDKPath = Environment.GetEnvironmentVariable("VULKAN_SDK");
            bool   bSDKInstalled = !String.IsNullOrEmpty(VulkanSDKPath);
            if (BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Linux || !bSDKInstalled)
            {
                AddEngineThirdPartyPrivateStaticDependencies(Target, "Vulkan");
            }
            else
            {
                PrivateIncludePaths.Add(VulkanSDKPath + "/include");
                PrivateIncludePaths.Add(VulkanSDKPath + "/include/vulkan");
                PublicLibraryPaths.Add(VulkanSDKPath + "/lib");
                PublicAdditionalLibraries.Add("vulkan");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Android || Target.Platform == UnrealTargetPlatform.Mac)
        {
            string VulkanSDKPath = Environment.GetEnvironmentVariable("VULKAN_SDK");

            bool bHaveVulkan = false;
            if (Target.Platform == UnrealTargetPlatform.Android)
            {
                // Note: header is the same for all architectures so just use arch-arm
                string NDKPath = Environment.GetEnvironmentVariable("NDKROOT");
                string NDKVulkanIncludePath = NDKPath + "/platforms/android-24/arch-arm/usr/include/vulkan";

                // Use NDK Vulkan header if discovered, or VulkanSDK if available
                if (File.Exists(NDKVulkanIncludePath + "/vulkan.h"))
                {
                    bHaveVulkan = true;
                    PrivateIncludePaths.Add(NDKVulkanIncludePath);
                }
                else
                if (!String.IsNullOrEmpty(VulkanSDKPath))
                {
                    // If the user has an installed SDK, use that instead
                    bHaveVulkan = true;
                    PrivateIncludePaths.Add(VulkanSDKPath + "/Include/vulkan");
                }
                else
                {
                    // Fall back to the Windows Vulkan SDK (the headers are the same)
                    bHaveVulkan = true;
                    PrivateIncludePaths.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "Vulkan/Windows/Include/vulkan");
                }
            }
            else if (!String.IsNullOrEmpty(VulkanSDKPath))
            {
                bHaveVulkan = true;
                PrivateIncludePaths.Add(VulkanSDKPath + "/Include");

                if (Target.Platform == UnrealTargetPlatform.Win32)
                {
                    PublicLibraryPaths.Add(VulkanSDKPath + "/Bin32");
                }
                else
                {
                    PublicLibraryPaths.Add(VulkanSDKPath + "/Bin");
                }

                PublicAdditionalLibraries.Add("vulkan-1.lib");
                PublicAdditionalLibraries.Add("vkstatic.1.lib");
            }

            if (bHaveVulkan)
            {
                if (Target.Configuration != UnrealTargetConfiguration.Shipping)
                {
                    PrivateIncludePathModuleNames.AddRange(
                        new string[]
                    {
                        "TaskGraph",
                    }
                        );
                }
            }
            else
            {
                PrecompileForTargets = PrecompileTargetsType.None;
            }
        }
        else
        {
            PrecompileForTargets = PrecompileTargetsType.None;
        }
    }
Пример #26
0
    public GoogleTest(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string RootPath             = Target.UEThirdPartySourceDirectory + "GoogleTest/";
        string DefaultConfiguration = "MinSizeRel";

        // Includes
        PublicSystemIncludePaths.Add(RootPath + "include/");

        // Libraries
        string PartialLibraryPath = "lib/" + Target.Platform.ToString() + "/";
        string LibraryPath        = RootPath;

        if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32)
        {
            PartialLibraryPath += "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();

            if (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT)
            {
                PartialLibraryPath += "/Debug";
            }
            else
            {
                PartialLibraryPath += "/" + DefaultConfiguration;
            }

            //if (!Target.IsMonolithic)
            //{
            //    PartialLibraryPath += "_Shared";
            //}

            PartialLibraryPath += "/";
            LibraryPath        += PartialLibraryPath;
            //i.e. Engine\Source\ThirdParty\GoogleTest\lib\Win64\VS2013\MinSizeRel_Shared\ 

            // I was unable to get non-monolithic windows builds working without crashing within the
            // time box I was given for the integration. The workaround is to ensure that all tests
            // are included in the same dll when building monolithic, otherwise error messages
            // will not be routed properly.

            // We should re-investigate this integration problem in the future, as more teams want to
            // adopt usage of the library

            //if (!Target.IsMonolithic)
            //{
            //    PublicAdditionalLibraries.Add("gmock_main.lib");
            //    RuntimeDependencies.Add(new RuntimeDependency("$(EngineDir)/Binaries/ThirdParty/GoogleTest/" + PartialLibraryPath + "gmock_main.dll"));
            //}
            //else
            //{
            PublicAdditionalLibraries.Add("gtest.lib");
            PublicAdditionalLibraries.Add("gmock.lib");
            PublicAdditionalLibraries.Add("gmock_main.lib");
            //}
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            if (Target.LinkType == TargetLinkType.Monolithic)
            {
                PartialLibraryPath += DefaultConfiguration + "/";
                LibraryPath        += PartialLibraryPath;

                PublicAdditionalLibraries.Add(LibraryPath + "libgtest.a");
                PublicAdditionalLibraries.Add(LibraryPath + "libgmock.a");
                PublicAdditionalLibraries.Add(LibraryPath + "libgmock_main.a");
            }
            else
            {
                PartialLibraryPath += DefaultConfiguration + "_Shared/";
                LibraryPath        += PartialLibraryPath;

                PublicAdditionalLibraries.Add(LibraryPath + "libgmock_main.dylib");
            }
        }

        PublicLibraryPaths.Add(LibraryPath);

        // The including module will also need these enabled
        Definitions.Add("WITH_GOOGLE_MOCK=1");
        Definitions.Add("WITH_GOOGLE_TEST=1");

        Definitions.Add("GTEST_HAS_POSIX_RE=0");

        if (Target.LinkType != TargetLinkType.Monolithic)
        {
            //Definitions.Add("GTEST_LINKED_AS_SHARED_LIBRARY=1");
        }
    }
Пример #27
0
    public UnrealEnginePython(TargetInfo Target)
#endif
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
        string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");

        bFasterWithoutUnity = string.IsNullOrEmpty(enableUnityBuild);

        PublicIncludePaths.AddRange(
            new string[] {
            // ... add public include paths required here ...
        }
            );


        PrivateIncludePaths.AddRange(
            new string[] {
            // ... add other private include paths required here ...
        }
            );


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "Sockets",
            "Networking"
            // ... add other public dependencies that you statically link with here ...
        }
            );


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "InputCore",
            "Slate",
            "SlateCore",
            "MovieScene",
            "LevelSequence",
            "HTTP",
            "UMG",
            "AppFramework",
            "RHI",
            "Voice",
            "RenderCore",
            "MovieSceneCapture",
            "Landscape",
            "Foliage",
            "AIModule"
            // ... add private dependencies that you statically link with here ...
        }
            );


#if WITH_FORWARDED_MODULE_RULES_CTOR
        BuildVersion Version;
        if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version))
        {
            if (Version.MinorVersion >= 18)
            {
                PrivateDependencyModuleNames.Add("ApplicationCore");
            }
        }
#endif


        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );

#if WITH_FORWARDED_MODULE_RULES_CTOR
        if (Target.bBuildEditor)
#else
        if (UEBuildConfiguration.bBuildEditor)
#endif
        {
            PrivateDependencyModuleNames.AddRange(new string[] {
                "UnrealEd",
                "LevelEditor",
                "BlueprintGraph",
                "Projects",
                "Sequencer",
                "SequencerWidgets",
                "AssetTools",
                "LevelSequenceEditor",
                "MovieSceneTools",
                "MovieSceneTracks",
                "CinematicCamera",
                "EditorStyle",
                "GraphEditor",
                "UMGEditor",
                "AIGraph",
                "RawMesh",
                "DesktopWidgets",
                "EditorWidgets",
                "FBX",
                "Persona",
                "PropertyEditor",
                "LandscapeEditor",
                "MaterialEditor"
            });
        }

        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
        {
            if (pythonHome == "")
            {
                pythonHome = DiscoverPythonPath(windowsKnownPaths, "Win64");
                if (pythonHome == "")
                {
                    throw new System.Exception("Unable to find Python installation");
                }
            }
            System.Console.WriteLine("Using Python at: " + pythonHome);
            PublicIncludePaths.Add(pythonHome);
            string libPath = GetWindowsPythonLibFile(pythonHome);
            PublicLibraryPaths.Add(Path.GetDirectoryName(libPath));
            PublicAdditionalLibraries.Add(libPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            if (pythonHome == "")
            {
                pythonHome = DiscoverPythonPath(macKnownPaths, "Mac");
                if (pythonHome == "")
                {
                    throw new System.Exception("Unable to find Python installation" + Target.Platform);
                }
            }
            System.Console.WriteLine("Using Python at: " + pythonHome);
            PublicIncludePaths.Add(pythonHome);
            string libPath = GetMacPythonLibFile(pythonHome);
            PublicLibraryPaths.Add(Path.GetDirectoryName(libPath));
            PublicDelayLoadDLLs.Add(libPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (pythonHome == "")
            {
                string includesPath = DiscoverLinuxPythonIncludesPath();
                if (includesPath == null)
                {
                    throw new System.Exception("Unable to find Python includes, please add a search path to linuxKnownIncludesPaths");
                }
                string libsPath = DiscoverLinuxPythonLibsPath();
                if (libsPath == null)
                {
                    throw new System.Exception("Unable to find Python libs, please add a search path to linuxKnownLibsPaths");
                }
                PublicIncludePaths.Add(includesPath);
                PublicAdditionalLibraries.Add(libsPath);
            }
            else
            {
                string[] items = pythonHome.Split(';');
                PublicIncludePaths.Add(items[0]);
                PublicAdditionalLibraries.Add(items[1]);
            }
        }
#if WITH_FORWARDED_MODULE_RULES_CTOR
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicIncludePaths.Add(System.IO.Path.Combine(ModuleDirectory, "../../android/python35/include"));
            PublicLibraryPaths.Add(System.IO.Path.Combine(ModuleDirectory, "../../android/armeabi-v7a"));
            PublicAdditionalLibraries.Add("python3.5m");

            string APLName    = "UnrealEnginePython_APL.xml";
            string RelAPLPath = Utils.MakePathRelativeTo(System.IO.Path.Combine(ModuleDirectory, APLName), Target.RelativeEnginePath);
            AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", RelAPLPath));
        }
#endif
    }
Пример #28
0
    public libstrophe(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string StrophePackagePath = Path.Combine(Target.UEThirdPartySourceDirectory, "libstrophe", "libstrophe-0.9.1");

        bool bIsSupported =
            Target.Platform == UnrealTargetPlatform.XboxOne ||
            Target.Platform == UnrealTargetPlatform.Android ||
            Target.Platform == UnrealTargetPlatform.IOS ||
            Target.Platform == UnrealTargetPlatform.Win32 ||
            Target.Platform == UnrealTargetPlatform.Win64 ||
            Target.Platform == UnrealTargetPlatform.PS4 ||
            Target.Platform == UnrealTargetPlatform.Mac ||
            Target.Platform == UnrealTargetPlatform.Switch ||
            Target.IsInPlatformGroup(UnrealPlatformGroup.Unix);

        if (bIsSupported)
        {
            PrivateDefinitions.Add("XML_STATIC");

            PublicSystemIncludePaths.Add(StrophePackagePath);

            string ConfigName = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT) ? "Debug" : "Release";

            if (!Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
            {
                AddEngineThirdPartyPrivateStaticDependencies(Target, "Expat");
            }

            if (Target.Platform == UnrealTargetPlatform.XboxOne)
            {
                // Use reflection to allow type not to exist if console code is not present
                string      ToolchainName       = "VS";
                System.Type XboxOnePlatformType = System.Type.GetType("UnrealBuildTool.XboxOnePlatform,UnrealBuildTool");
                if (XboxOnePlatformType != null)
                {
                    System.Object VersionName = XboxOnePlatformType.GetMethod("GetVisualStudioCompilerVersionName").Invoke(null, null);
                    ToolchainName += VersionName.ToString();
                }

                string LibraryPath = Path.Combine(StrophePackagePath, "XboxOne", ToolchainName, ConfigName);
                PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "strophe.lib"));
            }
            else if (Target.Platform == UnrealTargetPlatform.Android)
            {
                string LibraryPath = Path.Combine(StrophePackagePath, "Android", ConfigName);
                PublicLibraryPaths.Add(Path.Combine(LibraryPath, "armv7"));
                PublicLibraryPaths.Add(Path.Combine(LibraryPath, "arm64"));

                PublicAdditionalLibraries.Add("strophe");
            }
            else if (Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.Mac)
            {
                PublicAdditionalLibraries.Add(Path.Combine(StrophePackagePath, Target.Platform.ToString(), ConfigName, "libstrophe.a"));
                PublicAdditionalLibraries.Add("resolv");
            }
            else if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
            {
                PublicLibraryPaths.Add(Path.Combine(StrophePackagePath, Target.Platform.ToString(), "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName(), ConfigName));
                PublicAdditionalLibraries.Add("strophe.lib");
            }
            else if (Target.Platform == UnrealTargetPlatform.PS4)
            {
                PublicLibraryPaths.Add(Path.Combine(StrophePackagePath, Target.Platform.ToString(), ConfigName));
                PublicAdditionalLibraries.Add("strophe");
            }
            else if (Target.Platform == UnrealTargetPlatform.Switch)
            {
                PublicAdditionalLibraries.Add(Path.Combine(StrophePackagePath, Target.Platform.ToString(), ConfigName, "libstrophe.a"));
            }
            else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
            {
                PublicAdditionalLibraries.Add(Path.Combine(StrophePackagePath, "Linux", Target.Architecture.ToString(), ConfigName, "libstrophe" + ((Target.LinkType != TargetLinkType.Monolithic) ? "_fPIC" : "") + ".a"));
                PublicAdditionalLibraries.Add("resolv");
            }
        }
    }
Пример #29
0
    public Steamworks(ReadOnlyTargetRules Target) : base(Target)
    {
        /** Mark the current version of the Steam SDK */
        string SteamVersion = "v139";

        Type = ModuleType.External;

        PublicDefinitions.Add("STEAM_SDK_VER=TEXT(\"1.39\")");
        PublicDefinitions.Add("STEAM_SDK_VER_PATH=TEXT(\"Steam" + SteamVersion + "\")");

        string SdkBase = Target.UEThirdPartySourceDirectory + "Steamworks/Steam" + SteamVersion + "/sdk";

        if (!Directory.Exists(SdkBase))
        {
            string Err = string.Format("steamworks SDK not found in {0}", SdkBase);
            System.Console.WriteLine(Err);
            throw new BuildException(Err);
        }

        PublicIncludePaths.Add(SdkBase + "/public");

        string LibraryPath = SdkBase + "/redistributable_bin/";
        string LibraryName = "steam_api";

        if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            PublicLibraryPaths.Add(LibraryPath);
            PublicAdditionalLibraries.Add(LibraryName + ".lib");
            PublicDelayLoadDLLs.Add(LibraryName + ".dll");

            string SteamBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/Steamworks/Steam{0}/Win32/", SteamVersion);
            RuntimeDependencies.Add(SteamBinariesDir + "steam_api.dll");

            if (Target.Type == TargetType.Server)
            {
                RuntimeDependencies.Add(SteamBinariesDir + "steamclient.dll");
                RuntimeDependencies.Add(SteamBinariesDir + "tier0_s.dll");
                RuntimeDependencies.Add(SteamBinariesDir + "vstdlib_s.dll");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicLibraryPaths.Add(LibraryPath + "win64");
            PublicAdditionalLibraries.Add(LibraryName + "64.lib");
            PublicDelayLoadDLLs.Add(LibraryName + "64.dll");

            string SteamBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/Steamworks/Steam{0}/Win64/", SteamVersion);
            RuntimeDependencies.Add(SteamBinariesDir + LibraryName + "64.dll");

            if (Target.Type == TargetType.Server)
            {
                RuntimeDependencies.Add(SteamBinariesDir + "steamclient64.dll");
                RuntimeDependencies.Add(SteamBinariesDir + "tier0_s64.dll");
                RuntimeDependencies.Add(SteamBinariesDir + "vstdlib_s64.dll");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string SteamBinariesPath = String.Format(Target.UEThirdPartyBinariesDirectory + "Steamworks/Steam{0}/Mac/", SteamVersion);
            LibraryPath = SteamBinariesPath + "libsteam_api.dylib";
            PublicDelayLoadDLLs.Add(LibraryPath);
            RuntimeDependencies.Add(LibraryPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.LinkType == TargetLinkType.Monolithic)
            {
                LibraryPath += "linux64";
                PublicLibraryPaths.Add(LibraryPath);
                PublicAdditionalLibraries.Add(LibraryName);
            }
            else
            {
                LibraryPath += "linux64/libsteam_api.so";
                PublicDelayLoadDLLs.Add(LibraryPath);
            }
            string SteamBinariesPath = String.Format(Target.UEThirdPartyBinariesDirectory + "Steamworks/Steam{0}/{1}", SteamVersion, Target.Architecture);
            PrivateRuntimeLibraryPaths.Add(SteamBinariesPath);
            PublicAdditionalLibraries.Add(SteamBinariesPath + "/libsteam_api.so");
            RuntimeDependencies.Add(SteamBinariesPath + "/libsteam_api.so");
        }
    }
    public UElibPNG(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string libPNGPath = Target.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2";

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            string LibPath = libPNGPath + "/lib/Win64/VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(LibPath);

            string LibFileName = "libpng" + (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT ? "d" : "") + "_64.lib";
            PublicAdditionalLibraries.Add(LibFileName);
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            libPNGPath = libPNGPath + "/lib/Win32/VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(libPNGPath);

            string LibFileName = "libpng" + (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT ? "d" : "") + ".lib";
            PublicAdditionalLibraries.Add(LibFileName);
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicAdditionalLibraries.Add(libPNGPath + "/lib/Mac/libpng.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            if (Target.Architecture == "-simulator")
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/ios/Simulator");
            }
            else
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/ios/Device");
            }

            PublicAdditionalLibraries.Add("png152");
        }
        else if (Target.Platform == UnrealTargetPlatform.TVOS)
        {
            if (Target.Architecture == "-simulator")
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/TVOS/Simulator");
            }
            else
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/TVOS/Device");
            }

            PublicAdditionalLibraries.Add("png152");
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Android))
        {
            libPNGPath = Target.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.27";

            PublicLibraryPaths.Add(libPNGPath + "/lib/Android/ARMv7");
            PublicLibraryPaths.Add(libPNGPath + "/lib/Android/ARM64");
            PublicLibraryPaths.Add(libPNGPath + "/lib/Android/x86");
            PublicLibraryPaths.Add(libPNGPath + "/lib/Android/x64");

            PublicAdditionalLibraries.Add("png");
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            // migrate all architectures to the newer binary
            if (Target.Architecture.StartsWith("aarch64") || Target.Architecture.StartsWith("i686"))
            {
                libPNGPath = Target.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.27";
            }

            PublicAdditionalLibraries.Add(libPNGPath + "/lib/Linux/" + Target.Architecture + "/libpng.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicLibraryPaths.Add(libPNGPath + "/lib/HTML5");
            string OpimizationSuffix = "";
            if (Target.bCompileForSize)
            {
                OpimizationSuffix = "_Oz";
            }
            else
            {
                if (Target.Configuration == UnrealTargetConfiguration.Development)
                {
                    OpimizationSuffix = "_O2";
                }
                else if (Target.Configuration == UnrealTargetConfiguration.Shipping)
                {
                    OpimizationSuffix = "_O3";
                }
            }
            PublicAdditionalLibraries.Add(libPNGPath + "/lib/HTML5/libpng" + OpimizationSuffix + ".bc");
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            PublicLibraryPaths.Add(libPNGPath + "/lib/PS4");
            PublicAdditionalLibraries.Add("png152");
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            // Use reflection to allow type not to exist if console code is not present
            System.Type XboxOnePlatformType = System.Type.GetType("UnrealBuildTool.XboxOnePlatform,UnrealBuildTool");
            if (XboxOnePlatformType != null)
            {
                System.Object VersionName = XboxOnePlatformType.GetMethod("GetVisualStudioCompilerVersionName").Invoke(null, null);
                PublicLibraryPaths.Add(libPNGPath + "/lib/XboxOne/VS" + VersionName.ToString());
                PublicAdditionalLibraries.Add("libpng125_XboxOne.lib");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(libPNGPath, "lib/Switch/libPNG.a"));
        }

        PublicIncludePaths.Add(libPNGPath);
    }