public libWebSockets(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;
        string WebsocketPath  = Path.Combine(Target.UEThirdPartySourceDirectory, "libWebSockets", "libwebsockets");
        string PlatformSubdir = Target.Platform.ToString();

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

        switch (Target.Platform)
        {
        case UnrealTargetPlatform.HTML5:
            return;

        case UnrealTargetPlatform.Win64:
        case UnrealTargetPlatform.Win32:
            PlatformSubdir = Path.Combine(PlatformSubdir, "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName());
            PublicAdditionalLibraries.Add("websockets_static.lib");
            break;

        case UnrealTargetPlatform.Mac:
        case UnrealTargetPlatform.IOS:
            PublicAdditionalShadowFiles.Add(Path.Combine(WebsocketPath, "lib", Target.Platform.ToString(), ConfigurationSubdir, "libwebsockets.a"));
            PublicAdditionalLibraries.Add(Path.Combine(WebsocketPath, "lib", Target.Platform.ToString(), ConfigurationSubdir, "libwebsockets.a"));
            break;

        case UnrealTargetPlatform.PS4:
            PublicAdditionalLibraries.Add(Path.Combine(WebsocketPath, "lib", Target.Platform.ToString(), ConfigurationSubdir, "libwebsockets.a"));
            break;

        case UnrealTargetPlatform.Android:
            PublicIncludePaths.Add(Path.Combine(WebsocketPath, "include", PlatformSubdir, "ARMv7"));
            PublicLibraryPaths.Add(Path.Combine(WebsocketPath, "lib", Target.Platform.ToString(), "ARMv7", ConfigurationSubdir));
            PublicIncludePaths.Add(Path.Combine(WebsocketPath, "include", PlatformSubdir, "ARM64"));
            PublicLibraryPaths.Add(Path.Combine(WebsocketPath, "lib", Target.Platform.ToString(), "ARM64", ConfigurationSubdir));
            PublicIncludePaths.Add(Path.Combine(WebsocketPath, "include", PlatformSubdir, "x86"));
            PublicLibraryPaths.Add(Path.Combine(WebsocketPath, "lib", Target.Platform.ToString(), "x86", ConfigurationSubdir));
            PublicIncludePaths.Add(Path.Combine(WebsocketPath, "include", PlatformSubdir, "x64"));
            PublicLibraryPaths.Add(Path.Combine(WebsocketPath, "lib", Target.Platform.ToString(), "x64", ConfigurationSubdir));
            PublicAdditionalLibraries.Add("websockets");
            break;

        default:
            if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
            {
                PlatformSubdir = "Linux/" + Target.Architecture;
                PublicAdditionalLibraries.Add(Path.Combine(WebsocketPath, "lib", PlatformSubdir, ConfigurationSubdir, "libwebsockets.a"));
                break;
            }
            return;
        }

        if (Target.Platform != UnrealTargetPlatform.Android)
        {
            PublicLibraryPaths.Add(Path.Combine(WebsocketPath, "lib", PlatformSubdir, ConfigurationSubdir));
        }
        PublicIncludePaths.Add(Path.Combine(WebsocketPath, "include", PlatformSubdir));

        PublicDependencyModuleNames.Add("OpenSSL");
    }
Example #2
0
    public Facebook(TargetInfo Target)
    {
        Type = ModuleType.External;

        Definitions.Add("WITH_FACEBOOK=1");

        string FacebookPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "Facebook/";

        if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            string FacebookVersion = "3.16";
            if (FacebookVersion == "3.16")
            {
                Definitions.Add("FACEBOOK_VER_3_16=1");
            }

            FacebookPath += ("Facebook-IOS-" + FacebookVersion + "/");

            PublicIncludePaths.Add(FacebookPath + "Include");

            string LibDir = FacebookPath + "Lib/Release" + Target.Architecture;

            PublicLibraryPaths.Add(LibDir);
            PublicAdditionalLibraries.Add("Facebook-IOS-" + FacebookVersion);

            PublicAdditionalShadowFiles.Add(LibDir + "/libFacebook-IOS-" + FacebookVersion + ".a");

            AddThirdPartyPrivateStaticDependencies(Target, "Bolts");


            // Needed for the facebook sdk to link.
            PublicFrameworks.Add("CoreGraphics");
        }
    }
Example #3
0
    private void AddPublicAdditionalLibraries(string path, string libraryName)
    {
        var  targetPlatform = Target.Platform;
        bool isWindows      = (targetPlatform == UnrealTargetPlatform.Win32 || targetPlatform == UnrealTargetPlatform.Win64);

        string prefix        = (isWindows ? null : "lib");
        string fileExtension = (isWindows ? "lib" : "a");

        string libraryFilename = Path.Combine(path, CreateLibraryFilename(libraryName, prefix, fileExtension));

        if (isWindows)
        {
            PublicAdditionalLibraries.Add(libraryFilename);
        }
        else if (targetPlatform == UnrealTargetPlatform.Mac)
        {
            PublicAdditionalLibraries.Add(libraryFilename);
        }
        else if (targetPlatform == UnrealTargetPlatform.IOS)
        {
            PublicAdditionalLibraries.Add(libraryName);
            PublicAdditionalShadowFiles.Add(libraryFilename);
        }
        else
        {
            PublicAdditionalLibraries.Add(libraryName);
        }
    }
Example #4
0
    public OpenVR(ReadOnlyTargetRules Target) : base(Target)
    {
        /** Mark the current version of the OpenVR SDK */
        string OpenVRVersion = "v1_0_16";

        Type = ModuleType.External;

        string SdkBase = Target.UEThirdPartySourceDirectory + "OpenVR/OpenVR" + OpenVRVersion;

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

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

        string LibraryPath = SdkBase + "/lib/";

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

            string OpenVRBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/OpenVR/OpenVR{0}/Win32/", OpenVRVersion);
            RuntimeDependencies.Add(OpenVRBinariesDir + "openvr_api.dll");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicLibraryPaths.Add(LibraryPath + "win64");
            PublicAdditionalLibraries.Add("openvr_api.lib");
            PublicDelayLoadDLLs.Add("openvr_api.dll");

            string OpenVRBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/OpenVR/OpenVR{0}/Win64/", OpenVRVersion);
            RuntimeDependencies.Add(OpenVRBinariesDir + "openvr_api.dll");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string DylibPath = Target.UEThirdPartyBinariesDirectory + "OpenVR/OpenVR" + OpenVRVersion + "/osx32/libopenvr_api.dylib";
            PublicDelayLoadDLLs.Add(DylibPath);
            PublicAdditionalShadowFiles.Add(DylibPath);
            RuntimeDependencies.Add(DylibPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux && Target.Architecture.StartsWith("x86_64"))
        {
            PublicLibraryPaths.Add(LibraryPath + "linux64");
            PublicAdditionalLibraries.Add("openvr_api");

            string DylibDir = Target.UEThirdPartyBinariesDirectory + "OpenVR/OpenVR" + OpenVRVersion + "/linux64";
            PrivateRuntimeLibraryPaths.Add(DylibDir);

            string DylibPath = DylibDir + "/libopenvr_api.so";
            PublicDelayLoadDLLs.Add(DylibPath);
            RuntimeDependencies.Add(DylibPath);
        }
    }
Example #5
0
    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.Win64) ||
            (Target.Platform == UnrealTargetPlatform.Win32))
        {
            if (Target.Platform == UnrealTargetPlatform.Win64)
            {
                LibraryPath += "win64";
                LibraryName += "64";
            }
            PublicLibraryPaths.Add(LibraryPath);
            PublicAdditionalLibraries.Add(LibraryName + ".lib");
            PublicDelayLoadDLLs.Add(LibraryName + ".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);
            }
        }
    }
Example #6
0
    public UElibJPG(TargetInfo Target)
    {
        Type = ModuleType.External;

        string libJPGPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "libJPG";

        PublicIncludePaths.Add(libJPGPath);

        // cpp files being used like header files in implementation
        PublicAdditionalShadowFiles.Add(libJPGPath + "/jpgd.cpp");
        PublicAdditionalShadowFiles.Add(libJPGPath + "/jpge.cpp");
    }
Example #7
0
    public UElibJPG(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string libJPGPath = Target.UEThirdPartySourceDirectory + "libJPG";

        PublicIncludePaths.Add(libJPGPath);

        // cpp files being used like header files in implementation
        PublicAdditionalShadowFiles.Add(libJPGPath + "/jpgd.cpp");
        PublicAdditionalShadowFiles.Add(libJPGPath + "/jpge.cpp");

        bEnableShadowVariableWarnings = false;
    }
Example #8
0
    public OpenVR(TargetInfo Target)
    {
        /** Mark the current version of the OpenVR SDK */
        string OpenVRVersion = "v0_9_12";

        Type = ModuleType.External;

        string SdkBase = UEBuildConfiguration.UEThirdPartySourceDirectory + "OpenVR/OpenVR" + OpenVRVersion;

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

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

        string LibraryPath = SdkBase + "/lib/";

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

            string OpenVRBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/OpenVR/OpenVR{0}/Win32/", OpenVRVersion);
            RuntimeDependencies.Add(new RuntimeDependency(OpenVRBinariesDir + "openvr_api.dll"));
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicLibraryPaths.Add(LibraryPath + "win64");
            PublicAdditionalLibraries.Add("openvr_api.lib");
            PublicDelayLoadDLLs.Add("openvr_api.dll");

            string OpenVRBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/OpenVR/OpenVR{0}/Win64/", OpenVRVersion);
            RuntimeDependencies.Add(new RuntimeDependency(OpenVRBinariesDir + "openvr_api.dll"));
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string DylibPath = SdkBase + "/bin/osx32/libopenvr_api.dylib";
            PublicDelayLoadDLLs.Add(DylibPath);
            PublicAdditionalShadowFiles.Add(DylibPath);

            string OpenVRBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/OpenVR/OpenVR{0}/osx32/", OpenVRVersion);
            RuntimeDependencies.Add(new RuntimeDependency(OpenVRBinariesDir + "libopenvr_api.dylib"));
        }
    }
Example #9
0
    public Expat(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string ExpatPackagePath = Path.Combine(Target.UEThirdPartySourceDirectory, "Expat", "expat-2.2.0");

        if (Target.Platform != UnrealTargetPlatform.XboxOne &&
            Target.Platform != UnrealTargetPlatform.Android &&
            Target.Platform != UnrealTargetPlatform.IOS)
        {
            throw new BuildException("Unexpectedly pulled in Expat module. You may need to update Expat.build.cs for platform support");
        }

        string IncludePath = Path.Combine(ExpatPackagePath, "lib");

        PublicSystemIncludePaths.Add(IncludePath);

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

        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(ExpatPackagePath, "XboxOne", ToolchainName, ConfigName);
            PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "expat.lib"));
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            string LibraryPath = Path.Combine(ExpatPackagePath, "Android", ConfigName);
            PublicLibraryPaths.Add(Path.Combine(LibraryPath, "armv7"));
            PublicLibraryPaths.Add(Path.Combine(LibraryPath, "arm64"));

            PublicAdditionalLibraries.Add("expat");
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicAdditionalLibraries.Add(Path.Combine(ExpatPackagePath, "IOS", ConfigName, "libexpat.a"));
            PublicAdditionalShadowFiles.Add(Path.Combine(ExpatPackagePath, "IOS", ConfigName, "libexpat.a"));
        }
    }
Example #10
0
    public IntelISPCTexComp(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string LibraryPath  = Target.UEThirdPartySourceDirectory + "IntelISPCTexComp/ispc_texcomp/";
        string BinaryFolder = Target.UEThirdPartyBinariesDirectory + "IntelISPCTexComp/";

        PublicIncludePaths.Add(LibraryPath);

        //NOTE: If you change bUseDebugBuild, you must also change FTextureFormatIntelISPCTexCompModule.GetTextureFormat() to load the corresponding DLL
        bool bUseDebugBuild = false;

        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
        {
            string platformName = (Target.Platform == UnrealTargetPlatform.Win64) ? "Win64" : "Win32";
            string configName   = bUseDebugBuild ? "Debug" : "Release";
            string LibFolder    = LibraryPath + "lib/" + platformName + "-" + configName;
            string DLLFolder    = BinaryFolder + platformName + "-" + configName;
            string DLLFilePath  = DLLFolder + "/ispc_texcomp.dll";
            PublicLibraryPaths.Add(LibFolder);
            PublicLibraryPaths.Add(DLLFolder);
            PublicAdditionalLibraries.Add("ispc_texcomp.lib");
            PublicDelayLoadDLLs.Add("ispc_texcomp.dll");
            RuntimeDependencies.Add(DLLFilePath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string BinaryLibraryFolder = BinaryFolder + "Mac64-Release";
            string LibraryFilePath     = BinaryLibraryFolder + "/libispc_texcomp.dylib";
            PublicAdditionalLibraries.Add(LibraryFilePath);
            PublicDelayLoadDLLs.Add(LibraryFilePath);
            PublicAdditionalShadowFiles.Add(LibraryFilePath);
            RuntimeDependencies.Add(LibraryFilePath);
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix) && Target.Architecture.StartsWith("x86_64"))
        {
            string BinaryLibraryFolder = BinaryFolder + "Linux64-Release";
            PrivateRuntimeLibraryPaths.Add(BinaryLibraryFolder);
            string LibraryFilePath = BinaryLibraryFolder + "/libispc_texcomp.so";
            PublicAdditionalLibraries.Add(LibraryFilePath);
            PublicDelayLoadDLLs.Add("libispc_texcomp.so");
            RuntimeDependencies.Add(LibraryFilePath);
        }
    }
Example #11
0
    public coremod(TargetInfo Target)
    {
        Type = ModuleType.External;

        string CoreModVersion = "4.2.6";
        string LibraryPath    = UEBuildConfiguration.UEThirdPartySourceDirectory + "coremod/coremod-" + CoreModVersion + "/";

        PublicIncludePaths.Add(LibraryPath + "include/coremod");

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicLibraryPaths.Add(LibraryPath + "/lib/Win64/VS2013");
            PublicAdditionalLibraries.Add("coremod.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            PublicLibraryPaths.Add(LibraryPath + "/lib/Win32/VS2013");
            PublicAdditionalLibraries.Add("coremod.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicAdditionalLibraries.Add(LibraryPath + "/lib/Mac/libcoremodMac.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicLibraryPaths.Add(LibraryPath + "/lib/IOS");
            PublicAdditionalShadowFiles.Add(LibraryPath + "/lib/IOS/libcoremod.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            PublicAdditionalLibraries.Add(LibraryPath + "/lib/Linux/" + Target.Architecture + "/" + "libcoremodLinux.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            string AndroidPath = LibraryPath + "/lib/Android/";
            // No 64bit support for Android yet
            PublicLibraryPaths.Add(AndroidPath + "armeabi-v7a");
            PublicLibraryPaths.Add(AndroidPath + "x86");
            PublicLibraryPaths.Add(AndroidPath + "x64");
            PublicAdditionalLibraries.Add("xmp-coremod");
        }
    }
Example #12
0
    public Bolts(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        Definitions.Add("WITH_BOLTS=1");

        string BoltsPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "IOS/Bolts/";

        if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            BoltsPath += "Bolts/";

            PublicIncludePaths.Add(BoltsPath + "Bolts/Include");

            string LibDir = BoltsPath + "Lib/Release" + Target.Architecture;

            PublicLibraryPaths.Add(LibDir);
            PublicAdditionalLibraries.Add("Bolts");

            PublicAdditionalShadowFiles.Add(LibDir + "/libBolts.a");
        }
    }
Example #13
0
    public Noesis(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string NoesisBasePath    = ModuleDirectory + "/NoesisSDK/";
        string NoesisIncludePath = NoesisBasePath + "Include/";
        string NoesisInteractivityIncludePath = NoesisBasePath + "Src/Packages/App/Interactivity/Include/";

        PublicIncludePaths.Add(ModuleDirectory);
        PublicIncludePaths.Add(NoesisIncludePath);
        PublicIncludePaths.Add(NoesisInteractivityIncludePath);

        // Let's try to make sure the right version of the SDK is in the right place.
        const string RequiredRevision    = "(r7619)";
        const string RequiredVersionName = "2.2.0b5";

        if (!Directory.Exists(NoesisBasePath))
        {
            throw new BuildException("Could not find NoesisGUI SDK in " + NoesisBasePath + ". Minimum required version is " + RequiredVersionName);
        }

        if (!Directory.Exists(NoesisBasePath + "Bin"))
        {
            throw new BuildException("Could not find NoesisGUI SDK Bin directory in " + NoesisBasePath + "Bin. Minimum required version is " + RequiredVersionName);
        }

        if (!Directory.Exists(NoesisBasePath + "Include"))
        {
            throw new BuildException("Could not find NoesisGUI SDK Include directory in " + NoesisBasePath + "Include. Minimum required version is " + RequiredVersionName);
        }

        if (!Directory.Exists(NoesisBasePath + "Lib"))
        {
            throw new BuildException("Could not find NoesisGUI SDK Lib directory in " + NoesisBasePath + "Lib. Minimum required version is " + RequiredVersionName);
        }

        string NoesisSdkVersionInfo;

        try
        {
            NoesisSdkVersionInfo = File.ReadAllText(NoesisBasePath + "version.txt");
        }
        catch (Exception)
        {
            throw new BuildException("Could not find NoesisGUI SDK version.txt in " + NoesisBasePath + "version.txt. Minimum required version is " + RequiredVersionName);
        }

        string[] SplitVersion = NoesisSdkVersionInfo.Split(' ');
        if (String.Compare(SplitVersion[SplitVersion.Length - 1], RequiredRevision) < 0)
        {
            throw new BuildException("Wrong version of the NoesisGUI SDK installed in " + NoesisBasePath + ". Minimum required version is " + RequiredVersionName);
        }

        PublicSystemIncludePaths.Add(NoesisIncludePath);

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            string NoesisLibPath = NoesisBasePath + "Lib/windows_x86_64/";
            PublicLibraryPaths.Add(NoesisLibPath);
            PublicAdditionalLibraries.Add("Noesis.lib");
            PublicFrameworks.Add("CoreText");

            string BaseTargetPath = "";
            if (Target.LinkType == TargetLinkType.Monolithic)
            {
                if (Target.ProjectFile != null)
                {
                    BaseTargetPath = DirectoryReference.FromFile(Target.ProjectFile).ToString();
                }
            }
            else
            {
                BaseTargetPath = Target.RelativeEnginePath;
            }

            string NoesisDllPath       = "/NoesisSDK/Bin/windows_x86_64/Noesis.dll";
            string NoesisDllTargetPath = "/Binaries/Win64/Noesis.dll";

            if (Target.LinkType == TargetLinkType.Monolithic)
            {
                RuntimeDependencies.Add("$(ProjectDir)" + NoesisDllTargetPath);
            }
            else
            {
                RuntimeDependencies.Add("$(EngineDir)" + NoesisDllTargetPath);
            }

            if (BaseTargetPath != "")
            {
                try
                {
                    if (!System.IO.Directory.Exists(BaseTargetPath + "/Binaries/Win64"))
                    {
                        System.IO.Directory.CreateDirectory(BaseTargetPath + "/Binaries/Win64");
                    }
                    System.IO.File.Copy(ModuleDirectory + NoesisDllPath, BaseTargetPath + NoesisDllTargetPath, true);
                }
                catch (IOException Exception)
                {
                    if (Exception.HResult != -2147024864)                     // 0x80070020: The process cannot access the file ... because it is being used by another process.
                    {
                        throw;
                    }
                }
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string NoesisLibPath = NoesisBasePath + "Bin/osx/";
            PublicLibraryPaths.Add(NoesisLibPath);
            PublicAdditionalLibraries.Add(NoesisLibPath + "Noesis.dylib");

            string NoesisDylibPath = "/NoesisSDK/Bin/osx/Noesis.dylib";
            RuntimeDependencies.Add(ModuleDirectory + NoesisDylibPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            string NoesisLibPath = NoesisBasePath + "Lib/ios/";
            PublicLibraryPaths.Add(NoesisLibPath);
            PublicAdditionalLibraries.Add("Noesis");

            if (Target.Version.MinorVersion <= 21)
            {
                PublicAdditionalShadowFiles.Add(Path.Combine(NoesisLibPath, "libNoesis.a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            string NoesisLibPath = NoesisBasePath + "Bin/android_arm/";
            PublicLibraryPaths.Add(NoesisLibPath);
            string NoesisLib64Path = NoesisBasePath + "Bin/android_arm64/";
            PublicLibraryPaths.Add(NoesisLib64Path);
            PublicAdditionalLibraries.Add("Noesis");

            string NoesisAplPath = "/Noesis_APL.xml";
            AdditionalPropertiesForReceipt.Add("AndroidPlugin", ModuleDirectory + NoesisAplPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            string NoesisLibPath = NoesisBasePath + "Lib/ps4/";
            PublicAdditionalLibraries.Add(NoesisLibPath + "Noesis.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            string NoesisLibPath = NoesisBasePath + "Bin/xbox_one/";
            PublicLibraryPaths.Add(NoesisLibPath);
            PublicAdditionalLibraries.Add("Noesis.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            string NoesisLibPath = NoesisBasePath + "Bin/wasm/";
            PublicAdditionalLibraries.Add(NoesisLibPath + "Noesis.bc");
        }
    }
Example #14
0
    public PhysX(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        // Determine which kind of libraries to link against
        PhysXLibraryMode LibraryMode   = GetPhysXLibraryMode(Target.Configuration);
        string           LibrarySuffix = GetPhysXLibrarySuffix(LibraryMode);

        if (LibraryMode == PhysXLibraryMode.Shipping)
        {
            PublicDefinitions.Add("WITH_PHYSX_RELEASE=1");
        }
        else
        {
            PublicDefinitions.Add("WITH_PHYSX_RELEASE=0");
        }

        string PhysXVersion    = "PhysX_3.4";
        string PxSharedVersion = "PxShared";

        string PhysXDir    = Target.UEThirdPartySourceDirectory + "PhysX3/" + PhysXVersion + "/";
        string PxSharedDir = Target.UEThirdPartySourceDirectory + "PhysX3/" + PxSharedVersion + "/";

        string PhysXLibDir    = Target.UEThirdPartySourceDirectory + "PhysX3/Lib/";
        string PxSharedLibDir = Target.UEThirdPartySourceDirectory + "PhysX3/Lib/";

        string PhysXIncludeDir    = PhysXDir + "Include/";
        string PxSharedIncludeDir = PxSharedDir + "include/";

        PublicSystemIncludePaths.AddRange(
            new string[] {
            PxSharedIncludeDir,
            PxSharedIncludeDir + "cudamanager",
            PxSharedIncludeDir + "filebuf",
            PxSharedIncludeDir + "foundation",
            PxSharedIncludeDir + "pvd",
            PxSharedIncludeDir + "task",
            PhysXIncludeDir,
            PhysXIncludeDir + "foundation",
            PhysXIncludeDir + "cooking",
            PhysXIncludeDir + "common",
            PhysXIncludeDir + "extensions",
            PhysXIncludeDir + "geometry"
        }
            );

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

            string[] StaticLibrariesX64 = new string[] {
                "PhysX3{0}_x64.lib",
                "PhysX3Extensions{0}_x64.lib",
                "PhysX3Cooking{0}_x64.lib",
                "PhysX3Common{0}_x64.lib",
                "PsFastXml{0}_x64.lib",
                "PxFoundation{0}_x64.lib",
                "PxPvdSDK{0}_x64.lib",
                "PxTask{0}_x64.lib",
            };

            string[] DelayLoadDLLsX64 = new string[] {
                "PxFoundation{0}_x64.dll",
                "PxPvdSDK{0}_x64.dll",
                "PhysX3{0}_x64.dll",
                "PhysX3Cooking{0}_x64.dll",
                "PhysX3Common{0}_x64.dll",
            };

            string[] PxSharedRuntimeDependenciesX64 = new string[] {
                "PxFoundation{0}_x64.dll",
                "PxPvdSDK{0}_x64.dll",
            };

            foreach (string Lib in StaticLibrariesX64)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            foreach (string DLL in DelayLoadDLLsX64)
            {
                PublicDelayLoadDLLs.Add(String.Format(DLL, LibrarySuffix));
            }

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

            if (LibrarySuffix != "")
            {
                PublicDefinitions.Add("UE_PHYSX_SUFFIX=" + LibrarySuffix);
            }

            string PxSharedBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX3/Win64/VS{0}/", Target.WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string DLL in PxSharedRuntimeDependenciesX64)
            {
                RuntimeDependencies.Add(PxSharedBinariesDir + String.Format(DLL, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            PhysXLibDir    += "Win32/VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
            PxSharedLibDir += "Win32/VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] StaticLibrariesX86 = new string[] {
                "PhysX3{0}_x86.lib",
                "PhysX3Extensions{0}_x86.lib",
                "PhysX3Cooking{0}_x86.lib",
                "PhysX3Common{0}_x86.lib",
                "PsFastXml{0}_x86.lib",
                "PxFoundation{0}_x86.lib",
                "PxPvdSDK{0}_x86.lib",
                "PxTask{0}_x86.lib",
            };

            string[] DelayLoadDLLsX86 = new string[] {
                "PxFoundation{0}_x86.dll",
                "PxPvdSDK{0}_x86.dll",
                "PhysX3{0}_x86.dll",
                "PhysX3Cooking{0}_x86.dll",
                "PhysX3Common{0}_x86.dll"
            };

            foreach (string Lib in StaticLibrariesX86)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            foreach (string DLL in DelayLoadDLLsX86)
            {
                PublicDelayLoadDLLs.Add(String.Format(DLL, LibrarySuffix));
            }

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

            if (LibrarySuffix != "")
            {
                PublicDefinitions.Add("UE_PHYSX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PhysXLibDir    += "Mac";
            PxSharedLibDir += "Mac";
            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] StaticLibrariesMac = new string[] {
                PhysXLibDir + "/libLowLevel{0}.a",
                PhysXLibDir + "/libLowLevelCloth{0}.a",
                PhysXLibDir + "/libPhysX3Extensions{0}.a",
                PhysXLibDir + "/libSceneQuery{0}.a",
                PhysXLibDir + "/libSimulationController{0}.a",
                PxSharedLibDir + "/libPxTask{0}.a",
                PxSharedLibDir + "/libPsFastXml{0}.a"
            };

            foreach (string Lib in StaticLibrariesMac)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            string[] DynamicLibrariesMac = new string[] {
                "/libPhysX3{0}.dylib",
                "/libPhysX3Cooking{0}.dylib",
                "/libPhysX3Common{0}.dylib",
                "/libPxFoundation{0}.dylib",
                "/libPxPvdSDK{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(LibraryPath);
            }

            if (LibrarySuffix != "")
            {
                PublicDefinitions.Add("UE_PHYSX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARMv7");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x86");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARM64");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x64");

            PublicLibraryPaths.Add(PxSharedLibDir + "Android/ARMv7");
            PublicLibraryPaths.Add(PxSharedLibDir + "Android/x86");
            PublicLibraryPaths.Add(PxSharedLibDir + "Android/arm64");
            PublicLibraryPaths.Add(PxSharedLibDir + "Android/x64");

            string[] StaticLibrariesAndroid = new string[] {
                "PhysX3{0}",
                "PhysX3Extensions{0}",
                "PhysX3Cooking{0}",                 // not needed until Apex
                "PhysX3Common{0}",
                //"PhysXVisualDebuggerSDK{0}",
                "PxFoundation{0}",
                "PxPvdSDK{0}",
                "PsFastXml{0}"
            };

            //if you are shipping, and you actually want the shipping libs, you do not need this lib
            if (!(LibraryMode == PhysXLibraryMode.Shipping && Target.bUseShippingPhysXLibraries))
            {
//				PublicAdditionalLibraries.Add("nvToolsExt");
            }

            foreach (string Lib in StaticLibrariesAndroid)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            PhysXLibDir    += "/Linux/" + Target.Architecture;
            PxSharedLibDir += "/Linux/" + Target.Architecture;

            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] StaticLibrariesPhysXLinux = new string[] {
                "rt",
                "PhysX3{0}",
                "PhysX3Extensions{0}",
                "PhysX3Cooking{0}",
                "PhysX3Common{0}",
                "PxFoundation{0}",
                "PxPvdSDK{0}",
                "PsFastXml{0}"
            };

            foreach (string Lib in StaticLibrariesPhysXLinux)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            if (Target.bCompileAPEX)
            {
                string[] StaticLibrariesApexLinux = new string[] {
                    "NvParameterized{0}",
                    "RenderDebug{0}"
                };

                foreach (string Lib in StaticLibrariesApexLinux)
                {
                    PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
                }
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PhysXLibDir    = Path.Combine(PhysXLibDir, "IOS/");
            PxSharedLibDir = Path.Combine(PxSharedLibDir, "IOS/");
            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] PhysXLibs = new string[]
            {
                "LowLevel",
                "LowLevelAABB",
                "LowLevelCloth",
                "LowLevelDynamics",
                "LowLevelParticles",
                "PhysX3",
                "PhysX3Common",
                // "PhysX3Cooking", // not needed until Apex
                "PhysX3Extensions",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            foreach (string PhysXLib in PhysXLibs)
            {
                PublicAdditionalLibraries.Add(PhysXLib + LibrarySuffix);
                PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "lib" + PhysXLib + LibrarySuffix + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.TVOS)
        {
            PhysXLibDir    = Path.Combine(PhysXLibDir, "TVOS/");
            PxSharedLibDir = Path.Combine(PxSharedLibDir, "TVOS/");
            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] PhysXLibs = new string[]
            {
                "LowLevel",
                "LowLevelAABB",
                "LowLevelCloth",
                "LowLevelDynamics",
                "LowLevelParticles",
                "PhysX3",
                "PhysX3Common",
                // "PhysX3Cooking", // not needed until Apex
                "PhysX3Extensions",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            foreach (string PhysXLib in PhysXLibs)
            {
                PublicAdditionalLibraries.Add(PhysXLib + LibrarySuffix);
                PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "lib" + PhysXLib + LibrarySuffix + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PhysXLibDir    = Path.Combine(PhysXLibDir, "HTML5/");
            PxSharedLibDir = Path.Combine(PxSharedLibDir, "HTML5/");

            string[] PhysXLibs = new string[]
            {
                "LowLevel",
                "LowLevelAABB",
                "LowLevelCloth",
                "LowLevelDynamics",
                "LowLevelParticles",
                "PhysX3",
                "PhysX3CharacterKinematic",
                "PhysX3Common",
                "PhysX3Cooking",
                "PhysX3Extensions",
                //"PhysXVisualDebuggerSDK",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            string OpimizationSuffix = "";
            if (Target.bCompileForSize)
            {
                OpimizationSuffix = "_Oz";
            }
            else
            {
                if (Target.Configuration == UnrealTargetConfiguration.Development)
                {
                    OpimizationSuffix = "_O2";
                }
                else if (Target.Configuration == UnrealTargetConfiguration.Shipping)
                {
                    OpimizationSuffix = "_O3";
                }
            }

            foreach (var lib in PhysXLibs)
            {
                PublicAdditionalLibraries.Add(PhysXLibDir + lib + OpimizationSuffix + ".bc");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "PS4");

            string[] StaticLibrariesPS4 = new string[] {
                "PhysX3{0}",
                "PhysX3Extensions{0}",
                "PhysX3Cooking{0}",
                "PhysX3Common{0}",
                "LowLevel{0}",
                "LowLevelAABB{0}",
                "LowLevelCloth{0}",
                "LowLevelDynamics{0}",
                "LowLevelParticles{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
                "PxFoundation{0}",
                "PxTask{0}",
                "PxPvdSDK{0}",
                "PsFastXml{0}"
            };

            foreach (string Lib in StaticLibrariesPS4)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            PublicDefinitions.Add("PX_PHYSX_STATIC_LIB=1");
            PublicDefinitions.Add("_XBOX_ONE=1");

            PublicLibraryPaths.Add(Path.Combine(PhysXLibDir, "XboxOne\\VS2015"));

            string[] StaticLibrariesXB1 = new string[] {
                "PhysX3{0}.lib",
                "PhysX3Extensions{0}.lib",
                "PhysX3Cooking{0}.lib",
                "PhysX3Common{0}.lib",
                "LowLevel{0}.lib",
                "LowLevelAABB{0}.lib",
                "LowLevelCloth{0}.lib",
                "LowLevelDynamics{0}.lib",
                "LowLevelParticles{0}.lib",
                "SceneQuery{0}.lib",
                "SimulationController{0}.lib",
                "PxFoundation{0}.lib",
                "PxTask{0}.lib",
                "PxPvdSDK{0}.lib",
                "PsFastXml{0}.lib"
            };

            foreach (string Lib in StaticLibrariesXB1)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Switch");
            PublicLibraryPaths.Add(PxSharedLibDir + "Switch");

            string[] StaticLibrariesSwitch = new string[] {
                "LowLevel",
                "LowLevelAABB",
                "LowLevelCloth",
                "LowLevelDynamics",
                "LowLevelParticles",
                "PhysX3",
                "PhysX3Common",
                "PhysX3Cooking",
                "PhysX3Extensions",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            foreach (string Lib in StaticLibrariesSwitch)
            {
                PublicAdditionalLibraries.Add(Lib + LibrarySuffix);
            }
        }
    }
Example #15
0
    public WebSocket(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

        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)
        {
            Definitions.Add("PLATFORM_UWP=0");
            Definitions.Add("LOAD_ROOT_CERTIFICATES_FROM_WIN32_STORE=1");
            PrivateDependencyModuleNames.Add("zlib");
            PrivateDependencyModuleNames.Add("OpenSSL");
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Win64");

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


            string[] StaticLibrariesX64 = new string[] {
                "websockets_static.lib",
                //"libcrypto.lib",
                //"libssl.lib",
            };

            foreach (string Lib in StaticLibrariesX64)
            {
                PublicAdditionalLibraries.Add(Lib);
            }
        }
        if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            Definitions.Add("PLATFORM_UWP=0");
            Definitions.Add("LOAD_ROOT_CERTIFICATES_FROM_WIN32_STORE=1");
            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);


            string[] StaticLibrariesX32 = new string[] {
                "websockets_static.lib",
                //"libcrypto.lib",
                //"libssl.lib",
            };

            foreach (string Lib in StaticLibrariesX32)
            {
                PublicAdditionalLibraries.Add(Lib);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            Definitions.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)
        {
            Definitions.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)
        {
            Definitions.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)
        {
            Definitions.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)
        {
            Definitions.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[] StaticLibrariesAndroid = new string[] {
                "websockets",
                //"ssl",
                //"crypto"
            };

            foreach (string Lib in StaticLibrariesAndroid)
            {
                PublicAdditionalLibraries.Add(Lib);
            }
        }
    }
Example #16
0
    public UElibPNG(TargetInfo Target)
    {
        Type = ModuleType.External;

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

        PublicIncludePaths.Add(libPNGPath);

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

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

            string LibFileName = "libpng" + (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.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");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/ios/Simulator/libpng152.a");
            }
            else
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/ios/Device");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/ios/Device/libpng152.a");
            }

            PublicAdditionalLibraries.Add("png152");
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            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.Platform == UnrealTargetPlatform.Linux)
        {
            PublicAdditionalLibraries.Add(libPNGPath + "/lib/Linux/" + Target.Architecture + "/libpng.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicLibraryPaths.Add(libPNGPath + "/lib/HTML5");

            if (UEBuildConfiguration.bCompileForSize)
            {
                PublicAdditionalLibraries.Add(libPNGPath + "/lib/HTML5/libpng_Oz.bc");
            }
            else
            {
                PublicAdditionalLibraries.Add(libPNGPath + "/lib/HTML5/libpng.bc");
            }
        }
    }
Example #17
0
    public PhysXVehicleLib(TargetInfo Target)
    {
        Type = ModuleType.External;

        // Determine which kind of libraries to link against
        PhysXLibraryMode LibraryMode   = GetPhysXLibraryMode(Target.Configuration);
        string           LibrarySuffix = GetPhysXLibrarySuffix(LibraryMode);

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

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

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}_x64.lib", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32 || (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32"))
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Win32/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName());

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}_x86.lib", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Mac");

            PublicAdditionalLibraries.Add(String.Format(PhysXLibDir + "Mac/libPhysX3Vehicle{0}.a", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARMv7");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x86");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARM64");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x64");

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Linux/" + Target.Architecture);

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "IOS");

            PublicAdditionalLibraries.Add("PhysX3Vehicle" + LibrarySuffix);
            PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "IOS", "libPhysX3Vehicle" + LibrarySuffix + ".a"));
        }
        else if (Target.Platform == UnrealTargetPlatform.TVOS)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "TVOS");

            PublicAdditionalLibraries.Add("PhysX3Vehicle" + LibrarySuffix);
            PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "TVOS", "libPhysX3Vehicle" + LibrarySuffix + ".a"));
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicAdditionalLibraries.Add(PhysXLibDir + "HTML5/PhysX3Vehicle" + (UEBuildConfiguration.bCompileForSize ? "_Oz" : "") + ".bc");
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "PS4");

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            PublicLibraryPaths.Add(Path.Combine(PhysXLibDir, "XboxOne\\VS" + WindowsPlatform.GetVisualStudioCompilerVersionName()));

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}.lib", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Switch");

            PublicAdditionalLibraries.Add("PhysX3Vehicle" + LibrarySuffix);
        }
    }
    public PhysXVehicleLib(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        // Determine which kind of libraries to link against
        PhysXLibraryMode LibraryMode   = GetPhysXLibraryMode(Target.Configuration);
        string           LibrarySuffix = GetPhysXLibrarySuffix(LibraryMode);

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

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

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}_x64.lib", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Win32/VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName());

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}_x86.lib", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Mac");

            PublicAdditionalLibraries.Add(String.Format(PhysXLibDir + "Mac/libPhysX3Vehicle{0}.a", LibrarySuffix));
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Android))
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARMv7");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x86");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARM64");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x64");

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}", LibrarySuffix));
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Linux/" + Target.Architecture);

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "IOS");

            PublicAdditionalLibraries.Add("PhysX3Vehicle" + LibrarySuffix);
            PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "IOS", "libPhysX3Vehicle" + LibrarySuffix + ".a"));
        }
        else if (Target.Platform == UnrealTargetPlatform.TVOS)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "TVOS");

            PublicAdditionalLibraries.Add("PhysX3Vehicle" + LibrarySuffix);
            PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "TVOS", "libPhysX3Vehicle" + LibrarySuffix + ".a"));
        }
        else if (Target.Platform == UnrealTargetPlatform.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(PhysXLibDir + "HTML5/PhysX3Vehicle" + OpimizationSuffix + ".bc");
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "PS4");

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            PublicLibraryPaths.Add(Path.Combine(PhysXLibDir, "XboxOne\\VS2015"));

            PublicAdditionalLibraries.Add(String.Format("PhysX3Vehicle{0}.lib", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Switch");

            PublicAdditionalLibraries.Add("PhysX3Vehicle" + LibrarySuffix);
        }
    }
    public ICU(TargetInfo Target)
    {
        Type = ModuleType.External;

        bool bNeedsDlls = false;

        string ICUVersion  = "icu4c-53_1";
        string ICURootPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "ICU/" + ICUVersion + "/";

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

        string PlatformFolderName = Target.Platform.ToString();

        string TargetSpecificPath = ICURootPath + PlatformFolderName + "/";

        if (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32") // simulator
        {
            TargetSpecificPath = ICURootPath + "Win32/";
        }

        if ((Target.Platform == UnrealTargetPlatform.Win64) ||
            (Target.Platform == UnrealTargetPlatform.Win32) ||
            (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32") // simulator
            )
        {
            string VSVersionFolderName = "VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            TargetSpecificPath += VSVersionFolderName + "/";

            string[] LibraryNameStems =
            {
                "dt",                   // Data
                "uc",                   // Unicode Common
                "in",                   // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };
            string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT) ?
                                        "d" : string.Empty;

            // Library Paths
            PublicLibraryPaths.Add(TargetSpecificPath + "lib" + "/");

            EICULinkType ICULinkType = Target.IsMonolithic ? EICULinkType.Static : EICULinkType.Dynamic;
            switch (ICULinkType)
            {
            case EICULinkType.Static:
                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "sicu" + Stem + LibraryNamePostfix + "." + "lib";
                    PublicAdditionalLibraries.Add(LibraryName);
                }
                break;

            case EICULinkType.Dynamic:
                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "icu" + Stem + LibraryNamePostfix + "." + "lib";
                    PublicAdditionalLibraries.Add(LibraryName);
                }

                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "icu" + Stem + LibraryNamePostfix + "53" + "." + "dll";
                    PublicDelayLoadDLLs.Add(LibraryName);
                }

                if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32)
                {
                    string BinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/ICU/{0}/{1}/VS{2}/", ICUVersion, Target.Platform.ToString(), WindowsPlatform.GetVisualStudioCompilerVersionName());
                    foreach (string Stem in LibraryNameStems)
                    {
                        string LibraryName = BinariesDir + String.Format("icu{0}{1}53.dll", Stem, LibraryNamePostfix);
                        RuntimeDependencies.Add(new RuntimeDependency(LibraryName));
                    }
                }

                bNeedsDlls = true;

                break;
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux || Target.Platform == UnrealTargetPlatform.Android)
        {
            string StaticLibraryExtension = "a";

            switch (Target.Platform)
            {
            case UnrealTargetPlatform.Linux:
                TargetSpecificPath += Target.Architecture + "/";
                break;

            case UnrealTargetPlatform.Android:
                PublicLibraryPaths.Add(TargetSpecificPath + "ARMv7/lib");
                PublicLibraryPaths.Add(TargetSpecificPath + "ARM64/lib");
                PublicLibraryPaths.Add(TargetSpecificPath + "x86/lib");
                PublicLibraryPaths.Add(TargetSpecificPath + "x64/lib");
                break;
            }

            string[] LibraryNameStems =
            {
                "data",                 // Data
                "uc",                   // Unicode Common
                "i18n",                 // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };
            string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT) ?
                                        "d" : string.Empty;

            // Library Paths
            // Temporarily? only link statically on Linux too
            //EICULinkType ICULinkType = (Target.Platform == UnrealTargetPlatform.Android || Target.IsMonolithic) ? EICULinkType.Static : EICULinkType.Dynamic;
            EICULinkType ICULinkType = EICULinkType.Static;
            switch (ICULinkType)
            {
            case EICULinkType.Static:
                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "icu" + Stem + LibraryNamePostfix;
                    if (Target.Platform == UnrealTargetPlatform.Android)
                    {
                        // we will filter out in the toolchain
                        PublicAdditionalLibraries.Add(LibraryName);                                 // Android requires only the filename.
                    }
                    else
                    {
                        PublicAdditionalLibraries.Add(TargetSpecificPath + "lib/" + "lib" + LibraryName + "." + StaticLibraryExtension);     // Linux seems to need the path, not just the filename.
                    }
                }
                break;

            case EICULinkType.Dynamic:
                if (Target.Platform == UnrealTargetPlatform.Linux)
                {
                    string PathToBinary = String.Format("$(EngineDir)/Binaries/ThirdParty/ICU/{0}/{1}/{2}/", ICUVersion, Target.Platform.ToString(),
                                                        Target.Architecture);

                    foreach (string Stem in LibraryNameStems)
                    {
                        string LibraryName = "icu" + Stem + LibraryNamePostfix;
                        string LibraryPath = UEBuildConfiguration.UEThirdPartyBinariesDirectory + "ICU/icu4c-53_1/Linux/" + Target.Architecture + "/";

                        PublicLibraryPaths.Add(LibraryPath);
                        PublicAdditionalLibraries.Add(LibraryName);

                        // add runtime dependencies (for staging)
                        RuntimeDependencies.Add(new RuntimeDependency(PathToBinary + "lib" + LibraryName + ".so"));
                        RuntimeDependencies.Add(new RuntimeDependency(PathToBinary + "lib" + LibraryName + ".so.53"));      // version-dependent
                    }
                }
                break;
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS)
        {
            string StaticLibraryExtension  = "a";
            string DynamicLibraryExtension = "dylib";

            string[] LibraryNameStems =
            {
                "data",                 // Data
                "uc",                   // Unicode Common
                "i18n",                 // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };
            string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT) ?
                                        "d" : string.Empty;

            EICULinkType ICULinkType = (Target.Platform == UnrealTargetPlatform.IOS || Target.IsMonolithic) ? EICULinkType.Static : EICULinkType.Dynamic;
            // Library Paths
            switch (ICULinkType)
            {
            case EICULinkType.Static:
                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "libicu" + Stem + LibraryNamePostfix + "." + StaticLibraryExtension;
                    PublicAdditionalLibraries.Add(TargetSpecificPath + "lib/" + LibraryName);
                    PublicAdditionalShadowFiles.Add(TargetSpecificPath + "lib/" + LibraryName);
                }
                break;

            case EICULinkType.Dynamic:
                foreach (string Stem in LibraryNameStems)
                {
                    if (Target.Platform == UnrealTargetPlatform.Mac)
                    {
                        string LibraryName = "libicu" + Stem + ".53.1" + LibraryNamePostfix + "." + DynamicLibraryExtension;
                        string LibraryPath = UEBuildConfiguration.UEThirdPartyBinariesDirectory + "ICU/icu4c-53_1/Mac/" + LibraryName;

                        PublicDelayLoadDLLs.Add(LibraryPath);
                        PublicAdditionalShadowFiles.Add(LibraryPath);
                        RuntimeDependencies.Add(new RuntimeDependency(LibraryPath));
                    }
                }

                bNeedsDlls = true;

                break;
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            // we don't bother with debug libraries on HTML5. Mainly because debugging isn't viable on html5 currently
            string StaticLibraryExtension = "bc";

            string[] LibraryNameStems =
            {
                "data",                 // Data
                "uc",                   // Unicode Common
                "i18n",                 // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };

            string OpimizationSuffix = "";
            if (UEBuildConfiguration.bCompileForSize)
            {
                OpimizationSuffix = "_Oz";
            }
            else
            {
                if (Target.Configuration == UnrealTargetConfiguration.Development)
                {
                    OpimizationSuffix = "_O2";
                }
                else if (Target.Configuration == UnrealTargetConfiguration.Shipping)
                {
                    OpimizationSuffix = "_O3";
                }
            }

            foreach (string Stem in LibraryNameStems)
            {
                string LibraryName = "libicu" + Stem + OpimizationSuffix + "." + StaticLibraryExtension;
                PublicAdditionalLibraries.Add(TargetSpecificPath + LibraryName);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            string   LibraryNamePrefix = "sicu";
            string[] LibraryNameStems  =
            {
                "dt",                   // Data
                "uc",                   // Unicode Common
                "in",                   // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };
            string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug) ?
                                        "d" : string.Empty;
            string LibraryExtension = "lib";
            foreach (string Stem in LibraryNameStems)
            {
                string LibraryName = ICURootPath + "PS4/lib/" + LibraryNamePrefix + Stem + LibraryNamePostfix + "." + LibraryExtension;
                PublicAdditionalLibraries.Add(LibraryName);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            string   LibraryNamePrefix = "sicu";
            string[] LibraryNameStems  =
            {
                "dt",                       // Data
                "uc",                       // Unicode Common
                "in",                       // Internationalization
                "le",                       // Layout Engine
                "lx",                       // Layout Extensions
                "io"                        // Input/Output
            };
            string LibraryNamePostfix = ""; //(Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT) ? "d" : string.Empty;
            string LibraryExtension   = "a";
            foreach (string Stem in LibraryNameStems)
            {
                string LibraryName = ICURootPath + "Switch/lib/" + LibraryNamePrefix + Stem + LibraryNamePostfix + "." + LibraryExtension;
                PublicAdditionalLibraries.Add(LibraryName);
            }
        }
        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)
            {
                string   LibraryNamePrefix = "sicu";
                string[] LibraryNameStems  =
                {
                    "dt",                       // Data
                    "uc",                       // Unicode Common
                    "in",                       // Internationalization
                    "le",                       // Layout Engine
                    "lx",                       // Layout Extensions
                    "io"                        // Input/Output
                };
                string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT) ?
                                            "d" : string.Empty;
                string LibraryExtension = "lib";
                foreach (string Stem in LibraryNameStems)
                {
                    System.Object VersionName = XboxOnePlatformType.GetMethod("GetVisualStudioCompilerVersionName").Invoke(null, null);
                    string        LibraryName = ICURootPath + "XboxOne/VS" + VersionName.ToString() + "/lib/" + LibraryNamePrefix + Stem + LibraryNamePostfix + "." + LibraryExtension;
                    PublicAdditionalLibraries.Add(LibraryName);
                }
            }
        }

        // common defines
        if ((Target.Platform == UnrealTargetPlatform.Win64) ||
            (Target.Platform == UnrealTargetPlatform.Win32) ||
            (Target.Platform == UnrealTargetPlatform.Linux) ||
            (Target.Platform == UnrealTargetPlatform.Android) ||
            (Target.Platform == UnrealTargetPlatform.Mac) ||
            (Target.Platform == UnrealTargetPlatform.IOS) ||
            (Target.Platform == UnrealTargetPlatform.TVOS) ||
            (Target.Platform == UnrealTargetPlatform.PS4) ||
            (Target.Platform == UnrealTargetPlatform.XboxOne) ||
            (Target.Platform == UnrealTargetPlatform.HTML5) ||
            (Target.Platform == UnrealTargetPlatform.Switch)
            )
        {
            // Definitions
            Definitions.Add("U_USING_ICU_NAMESPACE=0");              // Disables a using declaration for namespace "icu".
            Definitions.Add("U_STATIC_IMPLEMENTATION");              // Necessary for linking to ICU statically.
            Definitions.Add("U_NO_DEFAULT_INCLUDE_UTF_HEADERS=1");   // Disables unnecessary inclusion of headers - inclusions are for ease of use.
            Definitions.Add("UNISTR_FROM_CHAR_EXPLICIT=explicit");   // Makes UnicodeString constructors for ICU character types explicit.
            Definitions.Add("UNISTR_FROM_STRING_EXPLICIT=explicit"); // Makes UnicodeString constructors for "char"/ICU string types explicit.
            Definitions.Add("UCONFIG_NO_TRANSLITERATION=1");         // Disables declarations and compilation of unused ICU transliteration functionality.
        }

        if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            // Definitions
            Definitions.Add("ICU_NO_USER_DATA_OVERRIDE=1");
            Definitions.Add("U_PLATFORM=U_PF_ORBIS");
        }

        if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            // Definitions
            Definitions.Add("ICU_NO_USER_DATA_OVERRIDE=1");
            Definitions.Add("U_PLATFORM=U_PF_DURANGO");
        }

        Definitions.Add("NEEDS_ICU_DLLS=" + (bNeedsDlls ? "1" : "0"));
    }
Example #20
0
    public WebSocket(ReadOnlyTargetRules Target) : base(Target)
    {
        PublicIncludePaths.AddRange(
            new string[] {
            "WebSocket/Public"
            // ... add public include paths required here ...
        }
            );


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


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "Json",
            "JsonUtilities",
            // ... 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)
        {
            PrivateDependencyModuleNames.Add("zlib");
            PrivateDependencyModuleNames.Add("OpenSSL");
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Win64");

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


            string[] StaticLibrariesX64 = new string[] {
                "websockets_static.lib",
                //"libcrypto.lib",
                //"libssl.lib",
            };

            foreach (string Lib in StaticLibrariesX64)
            {
                PublicAdditionalLibraries.Add(Lib);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            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)
        {
            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)
        {
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/IOS");
            string strStaticPath = 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)
        {
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Android");
            string strStaticPath = Path.GetFullPath(Path.Combine(ModulePath, "ThirdParty/lib/Android/armeabi-v7a"));
            PublicLibraryPaths.Add(strStaticPath);


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

            foreach (string Lib in StaticLibrariesAndroid)
            {
                PublicAdditionalLibraries.Add(Lib);
            }

            string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
            AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", Path.Combine(PluginPath, "WebSocket_UPL.xml")));
        }
    }
Example #21
0
    public PhysX(TargetInfo Target)
    {
        Type = ModuleType.External;

        // Determine which kind of libraries to link against
        PhysXLibraryMode LibraryMode   = GetPhysXLibraryMode(Target.Configuration);
        string           LibrarySuffix = GetPhysXLibrarySuffix(LibraryMode);

        Definitions.Add("WITH_PHYSX=1");
        if (UEBuildConfiguration.bCompileAPEX == false)
        {
            // Since APEX is dependent on PhysX, if APEX is not being include, set the flag properly.
            // This will properly cover the case where PhysX is compiled but APEX is not.
            Definitions.Add("WITH_APEX=0");
        }
        if (UEBuildConfiguration.bCompilePhysXVehicle == false)
        {
            // Since PhysX Vehicle is dependent on PhysX, if Vehicle is not being include, set the flag properly.
            // This will properly cover the case where PhysX is compiled but Vehicle is not.
            Definitions.Add("WITH_VEHICLE=0");
        }

        if (LibraryMode == PhysXLibraryMode.Shipping)
        {
            Definitions.Add("WITH_PHYSX_RELEASE=1");
        }
        else
        {
            Definitions.Add("WITH_PHYSX_RELEASE=0");
        }

        string PhysXVersion    = "PhysX_3.4";
        string PxSharedVersion = "PxShared";

        string PhysXDir    = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/" + PhysXVersion + "/";
        string PxSharedDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/" + PxSharedVersion + "/";

        string PhysXLibDir    = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/Lib/";
        string PxSharedLibDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/Lib/";

        string PhysXIncludeDir    = PhysXDir + "Include/";
        string PxSharedIncludeDir = PxSharedDir + "include/";

        if (Target.Platform == UnrealTargetPlatform.WolfPlat)
        {
            // all physx includes in a WolfPlat subdir
            PhysXIncludeDir    = PhysXIncludeDir + "WolfPlat/";
            PxSharedIncludeDir = PxSharedIncludeDir + "WolfPlat/";
        }


        PublicSystemIncludePaths.AddRange(
            new string[] {
            PxSharedIncludeDir,
            PxSharedIncludeDir + "cudamanager",
            PxSharedIncludeDir + "filebuf",
            PxSharedIncludeDir + "foundation",
            PxSharedIncludeDir + "pvd",
            PxSharedIncludeDir + "task",
            PhysXIncludeDir,
            PhysXIncludeDir + "foundation",
            PhysXIncludeDir + "cooking",
            PhysXIncludeDir + "common",
            PhysXIncludeDir + "extensions",
            PhysXIncludeDir + "geometry",
            PhysXIncludeDir + "vehicle"
        }
            );

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

            string[] StaticLibrariesX64 = new string[] {
                "PhysX3{0}_x64.lib",
                "PhysX3Extensions{0}_x64.lib",
                "PhysX3Cooking{0}_x64.lib",
                "PhysX3Common{0}_x64.lib",
                "PhysX3Vehicle{0}_x64.lib",
                "PsFastXml{0}_x64.lib",
                "PxFoundation{0}_x64.lib",
                "PxPvdSDK{0}_x64.lib",
                "PxTask{0}_x64.lib",
            };

            string[] DelayLoadDLLsX64 = new string[] {
                "PxFoundation{0}_x64.dll",
                "PxPvdSDK{0}_x64.dll",
                "PhysX3{0}_x64.dll",
                "PhysX3Cooking{0}_x64.dll",
                "PhysX3Common{0}_x64.dll",
            };

            string[] PxSharedRuntimeDependenciesX64 = new string[] {
                "PxFoundation{0}_x64.dll",
                "PxPvdSDK{0}_x64.dll",
            };

            foreach (string Lib in StaticLibrariesX64)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            foreach (string DLL in DelayLoadDLLsX64)
            {
                PublicDelayLoadDLLs.Add(String.Format(DLL, LibrarySuffix));
            }

            string PhysXBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX/Win64/VS{0}/", WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string DLL in DelayLoadDLLsX64)
            {
                string FileName = PhysXBinariesDir + String.Format(DLL, LibrarySuffix);
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }

            if (LibrarySuffix != "")
            {
                Definitions.Add("UE_PHYSX_SUFFIX=" + LibrarySuffix);
            }

            string PxSharedBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX/Win64/VS{0}/", WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string DLL in PxSharedRuntimeDependenciesX64)
            {
                RuntimeDependencies.Add(new RuntimeDependency(PxSharedBinariesDir + String.Format(DLL, LibrarySuffix)));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32 || (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32"))
        {
            PhysXLibDir    += "Win32/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            PxSharedLibDir += "Win32/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] StaticLibrariesX86 = new string[] {
                "PhysX3{0}_x86.lib",
                "PhysX3Extensions{0}_x86.lib",
                "PhysX3Cooking{0}_x86.lib",
                "PhysX3Common{0}_x86.lib",
                "PhysX3Vehicle{0}_x86.lib",
                "PsFastXml{0}_x86.lib",
                "PxFoundation{0}_x86.lib",
                "PxPvdSDK{0}_x86.lib",
                "PxTask{0}_x86.lib",
            };

            string[] DelayLoadDLLsX86 = new string[] {
                "PxFoundation{0}_x86.dll",
                "PxPvdSDK{0}_x86.dll",
                "PhysX3{0}_x86.dll",
                "PhysX3Cooking{0}_x86.dll",
                "PhysX3Common{0}_x86.dll"
            };

            foreach (string Lib in StaticLibrariesX86)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            foreach (string DLL in DelayLoadDLLsX86)
            {
                PublicDelayLoadDLLs.Add(String.Format(DLL, LibrarySuffix));
            }

            string PhysXBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX/Win32/VS{0}/", WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string DLL in DelayLoadDLLsX86)
            {
                string FileName = PhysXBinariesDir + String.Format(DLL, LibrarySuffix);
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }

            if (LibrarySuffix != "")
            {
                Definitions.Add("UE_PHYSX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PhysXLibDir    += "Mac";
            PxSharedLibDir += "Mac";
            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] StaticLibrariesMac = new string[] {
                PhysXLibDir + "/libLowLevel{0}.a",
                PhysXLibDir + "/libLowLevelCloth{0}.a",
                PhysXLibDir + "/libPhysX3Extensions{0}.a",
                PhysXLibDir + "/libPhysX3Vehicle{0}.a",
                PhysXLibDir + "/libSceneQuery{0}.a",
                PhysXLibDir + "/libSimulationController{0}.a",
                PxSharedLibDir + "/libPxTask{0}.a",
                PxSharedLibDir + "/libPsFastXml{0}.a"
            };

            foreach (string Lib in StaticLibrariesMac)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            string[] DynamicLibrariesMac = new string[] {
                "/libPhysX3{0}.dylib",
                "/libPhysX3Cooking{0}.dylib",
                "/libPhysX3Common{0}.dylib",
                "/libPxFoundation{0}.dylib",
                "/libPxPvdSDK{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_PHYSX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARMv7");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x86");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARM64");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x64");

            PublicLibraryPaths.Add(PxSharedLibDir + "Android/ARMv7");
            PublicLibraryPaths.Add(PxSharedLibDir + "Android/x86");
            PublicLibraryPaths.Add(PxSharedLibDir + "Android/arm64");
            PublicLibraryPaths.Add(PxSharedLibDir + "Android/x64");

            string[] StaticLibrariesAndroid = new string[] {
                "LowLevel{0}",
                "LowLevelAABB{0}",
                "LowLevelCloth{0}",
                "LowLevelDynamics{0}",
                "LowLevelParticles{0}",
                "PhysX3{0}",
                "PhysX3Extensions{0}",
                // "PhysX3Cooking{0}", // not needed until Apex
                "PhysX3Common{0}",
                "PhysX3Vehicle{0}",
                //"PhysXVisualDebuggerSDK{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
                "PxFoundation{0}",
                "PxTask{0}",
                "PxPvdSDK{0}",
                "PsFastXml{0}"
            };

            //if you are shipping, and you actually want the shipping libs, you do not need this lib
            if (!(LibraryMode == PhysXLibraryMode.Shipping && BuildConfiguration.bUseShippingPhysXLibraries))
            {
//				PublicAdditionalLibraries.Add("nvToolsExt");
            }

            foreach (string Lib in StaticLibrariesAndroid)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            PhysXLibDir    += "/Linux/" + Target.Architecture;
            PxSharedLibDir += "/Linux/" + Target.Architecture;

            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] StaticLibrariesLinux = new string[] {
                "rt",
                "LowLevel{0}",
                "LowLevelAABB{0}",
                "LowLevelCloth{0}",
                "LowLevelDynamics{0}",
                "LowLevelParticles{0}",
                "NvParameterized{0}",
                "PhysX3{0}",
                "PhysX3Extensions{0}",
                "PhysX3Cooking{0}",
                "PhysX3Common{0}",
                "PhysX3Vehicle{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
                "PxFoundation{0}",
                "PxTask{0}",
                "PxPvdSDK{0}",
                "PsFastXml{0}",
                "RenderDebug{0}"
            };

            foreach (string Lib in StaticLibrariesLinux)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PhysXLibDir    = Path.Combine(PhysXLibDir, "IOS/");
            PxSharedLibDir = Path.Combine(PxSharedLibDir, "IOS/");
            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] PhysXLibs = new string[]
            {
                "LowLevel",
                "LowLevelAABB",
                "LowLevelCloth",
                "LowLevelDynamics",
                "LowLevelParticles",
                "PhysX3",
                "PhysX3Common",
                // "PhysX3Cooking", // not needed until Apex
                "PhysX3Extensions",
                "PhysX3Vehicle",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            foreach (string PhysXLib in PhysXLibs)
            {
                PublicAdditionalLibraries.Add(PhysXLib + LibrarySuffix);
                PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "lib" + PhysXLib + LibrarySuffix + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.TVOS)
        {
            PhysXLibDir    = Path.Combine(PhysXLibDir, "TVOS/");
            PxSharedLibDir = Path.Combine(PxSharedLibDir, "TVOS/");
            PublicLibraryPaths.Add(PhysXLibDir);
            PublicLibraryPaths.Add(PxSharedLibDir);

            string[] PhysXLibs = new string[]
            {
                "LowLevel",
                "LowLevelAABB",
                "LowLevelCloth",
                "LowLevelDynamics",
                "LowLevelParticles",
                "PhysX3",
                "PhysX3Common",
                // "PhysX3Cooking", // not needed until Apex
                "PhysX3Extensions",
                "PhysX3Vehicle",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            foreach (string PhysXLib in PhysXLibs)
            {
                PublicAdditionalLibraries.Add(PhysXLib + LibrarySuffix);
                PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "lib" + PhysXLib + LibrarySuffix + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PhysXLibDir    = Path.Combine(PhysXLibDir, "HTML5/");
            PxSharedLibDir = Path.Combine(PxSharedLibDir, "HTML5/");

            string[] PhysXLibs = new string[]
            {
                "LowLevel",
                "LowLevelCloth",
                "PhysX3",
                "PhysX3Common",
                "PhysX3Cooking",
                "PhysX3Extensions",
                //"PhysXVisualDebuggerSDK",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            foreach (var lib in PhysXLibs)
            {
                if (!lib.Contains("Cooking") || Target.IsCooked == false)
                {
                    PublicAdditionalLibraries.Add(PhysXLibDir + lib + (UEBuildConfiguration.bCompileForSize ? "_Oz" : "") + ".bc");
                }
            }

            if (UEBuildConfiguration.bCompilePhysXVehicle)
            {
                string[] PhysXVehicleLibs = new string[]
                {
                    "PhysX3Vehicle",
                };

                foreach (var lib in PhysXVehicleLibs)
                {
                    if (!lib.Contains("Cooking") || Target.IsCooked == false)
                    {
                        PublicAdditionalLibraries.Add(PhysXLibDir + lib + (UEBuildConfiguration.bCompileForSize ? "_Oz" : "") + ".bc");
                    }
                }
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "PS4");

            string[] StaticLibrariesPS4 = new string[] {
                "PhysX3{0}",
                "PhysX3Extensions{0}",
                "PhysX3Cooking{0}",
                "PhysX3Common{0}",
                "PhysX3Vehicle{0}",
                "LowLevel{0}",
                "LowLevelAABB{0}",
                "LowLevelCloth{0}",
                "LowLevelDynamics{0}",
                "LowLevelParticles{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
                "PxFoundation{0}",
                "PxTask{0}",
                "PxPvdSDK{0}",
                "PsFastXml{0}"
            };

            foreach (string Lib in StaticLibrariesPS4)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            Definitions.Add("PX_PHYSX_STATIC_LIB=1");
            Definitions.Add("_XBOX_ONE=1");

            PublicLibraryPaths.Add(Path.Combine(PhysXLibDir, "XboxOne\\VS" + WindowsPlatform.GetVisualStudioCompilerVersionName()));

            string[] StaticLibrariesXB1 = new string[] {
                "PhysX3{0}.lib",
                "PhysX3Extensions{0}.lib",
                "PhysX3Cooking{0}.lib",
                "PhysX3Common{0}.lib",
                "PhysX3Vehicle{0}.lib",
                "LowLevel{0}.lib",
                "LowLevelAABB{0}.lib",
                "LowLevelCloth{0}.lib",
                "LowLevelDynamics{0}.lib",
                "LowLevelParticles{0}.lib",
                "SceneQuery{0}.lib",
                "SimulationController{0}.lib",
                "PxFoundation{0}.lib",
                "PxTask{0}.lib",
                "PxPvdSDK{0}.lib",
                "PsFastXml{0}.lib"
            };

            foreach (string Lib in StaticLibrariesXB1)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.WolfPlat)
        {
            PublicLibraryPaths.Add(PhysXLibDir + "WolfPlat");
            PublicLibraryPaths.Add(PxSharedLibDir + "WolfPlat");

            string[] StaticLibrariesWolf = new string[] {
                "LowLevel",
                "LowLevelAABB",
                "LowLevelCloth",
                "LowLevelDynamics",
                "LowLevelParticles",
                "PhysX3",
                "PhysX3Common",
                // "PhysX3Cooking", // not needed until Apex
                "PhysX3Extensions",
                "PhysX3Vehicle",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            foreach (string Lib in StaticLibrariesWolf)
            {
                PublicAdditionalLibraries.Add(Lib + LibrarySuffix);
            }
        }
    }
    public GalaxySDK(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

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

        if (!Directory.Exists(IncludePath))
        {
            string Err = string.Format("Galaxy 'Include' folder not found: {0}", IncludePath);
            System.Console.WriteLine(Err);
            throw new BuildException(Err);
        }
        PublicIncludePaths.Add(IncludePath);

        if (!Directory.Exists(LibrariesPath))
        {
            string Err = string.Format(" Galaxy'Libraries' folder not found: {0}", LibrariesPath);
            System.Console.WriteLine(Err);
            throw new BuildException(Err);
        }
#if !UE_4_24_OR_LATER
        PublicLibraryPaths.Add(LibrariesPath);
#endif
        string galaxyDLLName;
        if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            galaxyDLLName = "Galaxy.dll";
            PublicDelayLoadDLLs.Add(galaxyDLLName);
            AddPublicLibrary(LibrariesPath, "Galaxy.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            galaxyDLLName = "Galaxy64.dll";
            PublicDelayLoadDLLs.Add(galaxyDLLName);
            AddPublicLibrary(LibrariesPath, "Galaxy64.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            galaxyDLLName = "libGalaxy64.dylib";
            string galaxyDLLPath = Path.Combine(LibrariesPath, galaxyDLLName);
            PublicDelayLoadDLLs.Add(galaxyDLLPath);
#if !UE_4_22_OR_LATER
            PublicAdditionalShadowFiles.Add(galaxyDLLPath);
            AdditionalBundleResources.Add(new UEBuildBundleResource(galaxyDLLPath, "MacOS"));
#endif
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            galaxyDLLName = "Galaxy64_Durango.dll";
            AddPublicLibrary(LibrariesPath, "Galaxy64_Durango.lib");
            // In order to compile this for XBOX, please copy 'delayimp.lib' binary from:
            // from: c:/Program Files (x86)/Microsoft Visual Studio/<version>/<Professional | Community>/VC/Tools/MSVC/<MS Tools version>/lib/x64/delayimp.lib
            // to: <game repository>/Plugins/OnlineSubsystemGOG/Source/ThirdParty/GalaxySDK/Libraries/
            AddPublicLibrary(LibrariesPath, "delayimp.lib");
            PublicDelayLoadDLLs.Add(galaxyDLLName);
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            galaxyDLLName = "libGalaxy64.prx";
            AddPublicLibrary(LibrariesPath, "Galaxy64_stub_weak");
        }
        else
        {
            string Err = string.Format("Unsupported platform: {0}", Target.Platform);
            System.Console.WriteLine(Err);
            throw new BuildException(Err);
        }

        AddPublicDefinition("GALAXY_DLL_NAME=" + galaxyDLLName);
        AddRuntimeDependency(Path.Combine(LibrariesPath, galaxyDLLName));
    }
Example #23
0
    public Steamworks(ReadOnlyTargetRules Target) : base(Target)
    {
        /** Mark the current version of the Steam SDK */
        string SteamVersion = "v139";

        Type = ModuleType.External;

        Definitions.Add("STEAM_SDK_VER=TEXT(\"1.39\")");
        Definitions.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(new RuntimeDependency(SteamBinariesDir + "steam_api.dll"));

            if (Target.Type == 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
            {
                // assume SteamController is needed
                RuntimeDependencies.Add(new RuntimeDependency("$(EngineDir)/Config/controller.vdf"));
            }
        }
        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 == 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
            {
                // assume SteamController is needed
                RuntimeDependencies.Add(new RuntimeDependency("$(EngineDir)/Config/controller.vdf"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            LibraryPath += "osx32/libsteam_api.dylib";
            PublicDelayLoadDLLs.Add(LibraryPath);
            PublicAdditionalShadowFiles.Add(LibraryPath);
            AdditionalBundleResources.Add(new UEBuildBundleResource(LibraryPath, "MacOS"));
        }
        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 SteamBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/Steamworks/Steam{0}/x86_64-unknown-linux-gnu/", SteamVersion);
            RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "libsteam_api.so"));
        }
    }
    public FreeType2(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        PublicDefinitions.Add("WITH_FREETYPE=1");

        string FreeType2Path;
        string FreeType2LibPath;

        switch (Target.Platform)
        {
        case UnrealTargetPlatform.Win32:
        case UnrealTargetPlatform.Win64:
        case UnrealTargetPlatform.XboxOne:
        case UnrealTargetPlatform.Switch:
        case UnrealTargetPlatform.PS4:
        case UnrealTargetPlatform.Linux:
        case UnrealTargetPlatform.HTML5:
            FreeType2Path = Target.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.6/";
            PublicSystemIncludePaths.Add(FreeType2Path + "Include");
            break;

        default:
            if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
            {
                FreeType2Path = Target.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.6/";
                PublicSystemIncludePaths.Add(FreeType2Path + "Include");
            }
            else
            {
                FreeType2Path = Target.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/";
                PublicSystemIncludePaths.Add(FreeType2Path + "include");
            }
            break;
        }

        FreeType2LibPath = FreeType2Path + "Lib/";

        if (Target.Platform == UnrealTargetPlatform.Win32 ||
            Target.Platform == UnrealTargetPlatform.Win64)
        {
            FreeType2LibPath += (Target.Platform == UnrealTargetPlatform.Win64) ? "Win64/" : "Win32/";
            FreeType2LibPath += "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();

            PublicLibraryPaths.Add(FreeType2LibPath);
            PublicAdditionalLibraries.Add("freetype26MT.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicAdditionalLibraries.Add(FreeType2LibPath + "Mac/libfreetype2412.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            if (Target.Architecture == "-simulator")
            {
                PublicLibraryPaths.Add(FreeType2LibPath + "ios/Simulator");
                PublicAdditionalShadowFiles.Add(Target.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/Lib/ios/Simulator/libfreetype2412.a");
            }
            else
            {
                PublicLibraryPaths.Add(FreeType2LibPath + "ios/Device");
                PublicAdditionalShadowFiles.Add(Target.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/Lib/ios/Device/libfreetype2412.a");
            }

            PublicAdditionalLibraries.Add("freetype2412");
        }
        else if (Target.Platform == UnrealTargetPlatform.TVOS)
        {
            if (Target.Architecture == "-simulator")
            {
                PublicLibraryPaths.Add(FreeType2LibPath + "TVOS/Simulator");
                PublicAdditionalShadowFiles.Add(Target.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/Lib/TVOS/Simulator/libfreetype2412.a");
            }
            else
            {
                PublicLibraryPaths.Add(FreeType2LibPath + "TVOS/Device");
                PublicAdditionalShadowFiles.Add(Target.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/Lib/TVOS/Device/libfreetype2412.a");
            }

            PublicAdditionalLibraries.Add("freetype2412");
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Android))
        {
            // filtered out in the toolchain
            PublicLibraryPaths.Add(FreeType2LibPath + "Android/ARMv7");
            PublicLibraryPaths.Add(FreeType2LibPath + "Android/ARM64");
            PublicLibraryPaths.Add(FreeType2LibPath + "Android/x86");
            PublicLibraryPaths.Add(FreeType2LibPath + "Android/x64");

            PublicAdditionalLibraries.Add("freetype2412");
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            if (Target.Type == TargetType.Server)
            {
                string Err = string.Format("{0} dedicated server is made to depend on {1}. We want to avoid this, please correct module dependencies.", Target.Platform.ToString(), this.ToString());
                System.Console.WriteLine(Err);
                throw new BuildException(Err);
            }

            PublicSystemIncludePaths.Add(FreeType2Path + "Include");

            if (Target.LinkType == TargetLinkType.Monolithic)
            {
                PublicAdditionalLibraries.Add(FreeType2LibPath + "Linux/" + Target.Architecture + "/libfreetype.a");
            }
            else
            {
                PublicAdditionalLibraries.Add(FreeType2LibPath + "Linux/" + Target.Architecture + "/libfreetype_fPIC.a");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicLibraryPaths.Add(FreeType2Path + "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(FreeType2Path + "Lib/HTML5/libfreetype260" + OpimizationSuffix + ".bc");
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            PublicLibraryPaths.Add(FreeType2LibPath + "PS4");
            PublicAdditionalLibraries.Add("freetype26");
        }
        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(FreeType2LibPath + "XboxOne/VS" + VersionName.ToString());
                PublicAdditionalLibraries.Add("freetype26.lib");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(FreeType2LibPath, "Switch/libFreetype.a"));
        }
    }
Example #25
0
    public PhysX(TargetInfo Target)
    {
        Type = ModuleType.External;

        // Determine which kind of libraries to link against
        PhysXLibraryMode LibraryMode   = GetPhysXLibraryMode(Target.Configuration);
        string           LibrarySuffix = GetPhysXLibrarySuffix(LibraryMode);

        Definitions.Add("WITH_PHYSX=1");
        if (UEBuildConfiguration.bCompileAPEX == false)
        {
            // Since APEX is dependent on PhysX, if APEX is not being include, set the flag properly.
            // This will properly cover the case where PhysX is compiled but APEX is not.
            Definitions.Add("WITH_APEX=0");
        }
        if (UEBuildConfiguration.bCompilePhysXVehicle == false)
        {
            // Since PhysX Vehicle is dependent on PhysX, if Vehicle is not being include, set the flag properly.
            // This will properly cover the case where PhysX is compiled but Vehicle is not.
            Definitions.Add("WITH_VEHICLE=0");
        }

        string PhysXDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/PhysX-3.3/";

        string PhysXLibDir = PhysXDir + "lib/";

        PublicSystemIncludePaths.AddRange(
            new string[] {
            PhysXDir + "include",
            PhysXDir + "include/foundation",
            PhysXDir + "include/cooking",
            PhysXDir + "include/common",
            PhysXDir + "include/extensions",
            PhysXDir + "include/geometry",
            PhysXDir + "include/vehicle"
        }
            );

        // Libraries and DLLs for windows platform
        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicSystemIncludePaths.Add(PhysXDir + "include/foundation/windows");

            PhysXLibDir += "Win64/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(PhysXLibDir);

            string[] StaticLibrariesX64 = new string[] {
                "PhysX3{0}_x64.lib",
                "PhysX3Extensions{0}.lib",
                "PhysX3Cooking{0}_x64.lib",
                "PhysX3Common{0}_x64.lib",
                "PhysX3Vehicle{0}.lib",
                "PxTask{0}.lib",
                "PhysXVisualDebuggerSDK{0}.lib",
                "PhysXProfileSDK{0}.lib"
            };

            string[] DelayLoadDLLsX64 = new string[] {
                "PhysX3{0}_x64.dll",
                "PhysX3Cooking{0}_x64.dll",
                "PhysX3Common{0}_x64.dll"
            };

            foreach (string Lib in StaticLibrariesX64)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            foreach (string DLL in DelayLoadDLLsX64)
            {
                PublicDelayLoadDLLs.Add(String.Format(DLL, LibrarySuffix));
            }

            PublicDelayLoadDLLs.Add("nvToolsExt64_1.dll");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32 || (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32"))
        {
            PublicIncludePaths.Add(PhysXDir + "include/foundation/windows");

            PhysXLibDir += "Win32/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(PhysXLibDir);

            string[] StaticLibrariesX86 = new string[] {
                "PhysX3{0}_x86.lib",
                "PhysX3Extensions{0}.lib",
                "PhysX3Cooking{0}_x86.lib",
                "PhysX3Common{0}_x86.lib",
                "PhysX3Vehicle{0}.lib",
                "PxTask{0}.lib",
                "PhysXVisualDebuggerSDK{0}.lib",
                "PhysXProfileSDK{0}.lib"
            };

            string[] DelayLoadDLLsX86 = new string[] {
                "PhysX3{0}_x86.dll",
                "PhysX3Cooking{0}_x86.dll",
                "PhysX3Common{0}_x86.dll"
            };

            foreach (string Lib in StaticLibrariesX86)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }

            foreach (string DLL in DelayLoadDLLsX86)
            {
                PublicDelayLoadDLLs.Add(String.Format(DLL, LibrarySuffix));
            }

            PublicDelayLoadDLLs.Add("nvToolsExt32_1.dll");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicSystemIncludePaths.Add(PhysXDir + "include/foundation/unix");

            PhysXLibDir += "/osx64";
            PublicLibraryPaths.Add(PhysXLibDir);

            string[] StaticLibrariesMac = new string[] {
                PhysXLibDir + "/libLowLevel{0}.a",
                PhysXLibDir + "/libLowLevelCloth{0}.a",
                PhysXLibDir + "/libPhysX3{0}.a",
                PhysXLibDir + "/libPhysX3CharacterKinematic{0}.a",
                PhysXLibDir + "/libPhysX3Extensions{0}.a",
                PhysXLibDir + "/libPhysX3Cooking{0}.a",
                PhysXLibDir + "/libPhysX3Common{0}.a",
                PhysXLibDir + "/libPhysX3Vehicle{0}.a",
                PhysXLibDir + "/libPxTask{0}.a",
                PhysXLibDir + "/libPhysXVisualDebuggerSDK{0}.a",
                PhysXLibDir + "/libPhysXProfileSDK{0}.a",
                PhysXLibDir + "/libPvdRuntime{0}.a",
                PhysXLibDir + "/libSceneQuery{0}.a",
                PhysXLibDir + "/libSimulationController{0}.a"
            };

            foreach (string Lib in StaticLibrariesMac)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PublicSystemIncludePaths.Add(PhysXDir + "include/foundation/unix");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/ARMv7");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x86");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/arm64");
            PublicLibraryPaths.Add(PhysXLibDir + "Android/x64");

            string[] StaticLibrariesAndroid = new string[] {
                "LowLevel{0}",
                "LowLevelCloth{0}",
                "PhysX3{0}",
                "PhysX3CharacterKinematic{0}",
                "PhysX3Extensions{0}",
                // "PhysX3Cooking{0}", // not needed until Apex
                "PhysX3Common{0}",
                "PhysX3Vehicle{0}",
                "PxTask{0}",
                "PhysXVisualDebuggerSDK{0}",
                "PhysXProfileSDK{0}",
                "PvdRuntime{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
            };

            // the "shipping" don't need the nvTools library
            if (LibraryMode != PhysXLibraryMode.Shipping || !bShippingBuildsActuallyUseShippingPhysXLibraries)
            {
                PublicAdditionalLibraries.Add("nvToolsExt");
            }

            foreach (string Lib in StaticLibrariesAndroid)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            PhysXLibDir += "/Linux/" + Target.Architecture;

            PublicSystemIncludePaths.Add(PhysXDir + "include/foundation/unix");
            PublicLibraryPaths.Add(PhysXLibDir);

            string[] StaticLibrariesLinux = new string[] {
                "rt",
                "LowLevel{0}",
                "LowLevelCloth{0}",
                "PhysX3{0}",
                "PhysX3CharacterKinematic{0}",
                "PhysX3Extensions{0}",
                "PhysX3Cooking{0}",
                "PhysX3Common{0}",
                "PhysX3Vehicle{0}",
                "PxTask{0}",
                "PhysXVisualDebuggerSDK{0}",
                "PhysXProfileSDK{0}",
                "PvdRuntime{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
            };

            if (LibraryMode == PhysXLibraryMode.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT)
            {
                //@TODO: Needed?
                PublicAdditionalLibraries.Add("m");
            }

            foreach (string Lib in StaticLibrariesLinux)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            PublicSystemIncludePaths.Add(PhysXDir + "include/foundation/unix");

            PhysXLibDir = Path.Combine(PhysXLibDir, "IOS/");
            PublicLibraryPaths.Add(PhysXLibDir);

            string[] PhysXLibs = new string[]
            {
                "LowLevel",
                "LowLevelCloth",
                "PhysX3",
                "PhysX3CharacterKinematic",
                "PhysX3Common",
                // "PhysX3Cooking", // not needed until Apex
                "PhysX3Extensions",
                "PhysX3Vehicle",
                "PxTask",
                "PhysXVisualDebuggerSDK",
                "PhysXProfileSDK",
                "PvdRuntime",
                "SceneQuery",
                "SimulationController",
            };

            foreach (string PhysXLib in PhysXLibs)
            {
                PublicAdditionalLibraries.Add(PhysXLib + LibrarySuffix);
                PublicAdditionalShadowFiles.Add(Path.Combine(PhysXLibDir, "lib" + PhysXLib + LibrarySuffix + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicSystemIncludePaths.Add(PhysXDir + "include/foundation/unix");

            PhysXLibDir = Path.Combine(PhysXLibDir, "HTML5/");

            string[] PhysXLibs = new string[]
            {
                "LowLevel",
                "LowLevelCloth",
                "PhysX3",
                "PhysX3CharacterKinematic",
                "PhysX3Common",
                "PhysX3Cooking",
                "PhysX3Extensions",
                "PxTask",
                "PhysXVisualDebuggerSDK",
                "PhysXProfileSDK",
                "PvdRuntime",
                "SceneQuery",
                "SimulationController",
            };

            foreach (var lib in PhysXLibs)
            {
                if (!lib.Contains("Cooking") || Target.IsCooked == false)
                {
                    PublicAdditionalLibraries.Add(PhysXLibDir + lib + (UEBuildConfiguration.bCompileForSize ? "_Oz" : "") + ".bc");
                }
            }

            if (UEBuildConfiguration.bCompilePhysXVehicle)
            {
                string[] PhysXVehicleLibs = new string[]
                {
                    "PhysX3Vehicle",
                };

                foreach (var lib in PhysXVehicleLibs)
                {
                    if (!lib.Contains("Cooking") || Target.IsCooked == false)
                    {
                        PublicAdditionalLibraries.Add(PhysXLibDir + lib + (UEBuildConfiguration.bCompileForSize ? "_Oz" : "") + ".bc");
                    }
                }
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            PublicSystemIncludePaths.Add(PhysXDir + "include/foundation/PS4");
            PublicLibraryPaths.Add(PhysXDir + "lib/PS4");

            string[] StaticLibrariesPS4 = new string[] {
                "PhysX3{0}",
                "PhysX3Extensions{0}",
                "PhysX3Cooking{0}",
                "PhysX3Common{0}",
                "PhysX3Vehicle{0}",
                "PxTask{0}",
                "PhysXVisualDebuggerSDK{0}",
                "PhysXProfileSDK{0}"
            };

            foreach (string Lib in StaticLibrariesPS4)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            PublicSystemIncludePaths.Add("include/foundation/xboxone");
            PublicLibraryPaths.Add(PhysXDir + "Lib/XboxOne");

            string[] StaticLibrariesXB1 = new string[] {
                "PhysX3{0}.lib",
                "PhysX3Extensions{0}.lib",
                "PhysX3Cooking{0}.lib",
                "PhysX3Common{0}.lib",
                "PhysX3Vehicle{0}.lib",
                "PxTask{0}.lib",
                "PhysXVisualDebuggerSDK{0}.lib",
                "PhysXProfileSDK{0}.lib"
            };

            foreach (string Lib in StaticLibrariesXB1)
            {
                PublicAdditionalLibraries.Add(String.Format(Lib, LibrarySuffix));
            }
        }
    }
Example #26
0
    public ICU(TargetInfo Target)
    {
        Type = ModuleType.External;

        string ICURootPath = UEBuildConfiguration.UEThirdPartySourceDirectory + "ICU/icu4c-53_1/";

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

        string PlatformFolderName = Target.Platform.ToString();

        EICULinkType ICULinkType;

        switch (Target.Type)
        {
        case TargetRules.TargetType.Game:
        case TargetRules.TargetType.Client:
        case TargetRules.TargetType.Server:
            ICULinkType = EICULinkType.Static;
            break;

        case TargetRules.TargetType.Editor:
        case TargetRules.TargetType.Program:
            ICULinkType = EICULinkType.Dynamic;
            break;

        default:
            ICULinkType = EICULinkType.None;
            break;
        }

        string TargetSpecificPath = ICURootPath + PlatformFolderName + "/";

        if (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32")
        {
            TargetSpecificPath = ICURootPath + "Win32/";
        }

        if ((Target.Platform == UnrealTargetPlatform.Win64) ||
            (Target.Platform == UnrealTargetPlatform.Win32) ||
            (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32"))
        {
            string VSVersionFolderName = "VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            TargetSpecificPath += VSVersionFolderName + "/";

            string[] LibraryNameStems =
            {
                "dt",                   // Data
                "uc",                   // Unicode Common
                "in",                   // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };
            string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT) ?
                                        "d" : string.Empty;

            // Library Paths
            PublicLibraryPaths.Add(TargetSpecificPath + "lib" + "/");

            switch (ICULinkType)
            {
            case EICULinkType.Static:
                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "sicu" + Stem + LibraryNamePostfix + "." + "lib";
                    PublicAdditionalLibraries.Add(LibraryName);
                }
                break;

            case EICULinkType.Dynamic:
                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "icu" + Stem + LibraryNamePostfix + "." + "lib";
                    PublicAdditionalLibraries.Add(LibraryName);
                }

                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "icu" + Stem + LibraryNamePostfix + "53" + "." + "dll";
                    PublicDelayLoadDLLs.Add(LibraryName);
                }
                break;
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux || Target.Platform == UnrealTargetPlatform.Android)
        {
            string StaticLibraryExtension = "a";

            switch (Target.Platform)
            {
            case UnrealTargetPlatform.Linux:
                TargetSpecificPath += Target.Architecture + "/";
                break;

            case UnrealTargetPlatform.Android:
                PublicLibraryPaths.Add(TargetSpecificPath + "ARMv7/lib");
                PublicLibraryPaths.Add(TargetSpecificPath + "ARM64/lib");
                PublicLibraryPaths.Add(TargetSpecificPath + "x86/lib");
                PublicLibraryPaths.Add(TargetSpecificPath + "x64/lib");
                break;
            }

            string[] LibraryNameStems =
            {
                "data",                 // Data
                "uc",                   // Unicode Common
                "i18n",                 // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };
            string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT) ?
                                        "d" : string.Empty;

            // Library Paths
            switch (ICULinkType)
            {
            case EICULinkType.Static:
                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "icu" + Stem + LibraryNamePostfix;
                    if (Target.Platform == UnrealTargetPlatform.Android)
                    {
                        // we will filter out in the toolchain
                        PublicAdditionalLibraries.Add(LibraryName);                                 // Android requires only the filename.
                    }
                    else
                    {
                        PublicAdditionalLibraries.Add(TargetSpecificPath + "lib/" + "lib" + LibraryName + "." + StaticLibraryExtension);     // Linux seems to need the path, not just the filename.
                    }
                }
                break;

            case EICULinkType.Dynamic:
                foreach (string Stem in LibraryNameStems)
                {
                    if (Target.Platform == UnrealTargetPlatform.Linux)
                    {
                        string LibraryName = "icu" + Stem + LibraryNamePostfix;
                        string LibraryPath = UEBuildConfiguration.UEThirdPartyBinariesDirectory + "ICU/icu4c-53_1/Linux/" + Target.Architecture + "/";

                        PublicLibraryPaths.Add(LibraryPath);
                        PublicAdditionalLibraries.Add(LibraryName);
                    }
                }
                break;
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.IOS)
        {
            string StaticLibraryExtension  = "a";
            string DynamicLibraryExtension = "dylib";

            string[] LibraryNameStems =
            {
                "data",                 // Data
                "uc",                   // Unicode Common
                "i18n",                 // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };
            string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT) ?
                                        "d" : string.Empty;

            // Library Paths
            switch (ICULinkType)
            {
            case EICULinkType.Static:
                foreach (string Stem in LibraryNameStems)
                {
                    string LibraryName = "libicu" + Stem + LibraryNamePostfix + "." + StaticLibraryExtension;
                    PublicAdditionalLibraries.Add(TargetSpecificPath + "lib/" + LibraryName);
                    if (Target.Platform == UnrealTargetPlatform.IOS)
                    {
                        PublicAdditionalShadowFiles.Add(TargetSpecificPath + "lib/" + LibraryName);
                    }
                }
                break;

            case EICULinkType.Dynamic:
                foreach (string Stem in LibraryNameStems)
                {
                    if (Target.Platform == UnrealTargetPlatform.Mac)
                    {
                        string LibraryName = "libicu" + Stem + ".53.1" + LibraryNamePostfix + "." + DynamicLibraryExtension;
                        string LibraryPath = UEBuildConfiguration.UEThirdPartyBinariesDirectory + "ICU/icu4c-53_1/Mac/" + LibraryName;

                        PublicDelayLoadDLLs.Add(LibraryPath);
                        PublicAdditionalShadowFiles.Add(LibraryPath);
                    }
                    else if (Target.Platform == UnrealTargetPlatform.Linux)
                    {
                        string LibraryName = "icu" + Stem + LibraryNamePostfix;
                        string LibraryPath = UEBuildConfiguration.UEThirdPartyBinariesDirectory + "ICU/icu4c-53_1/Linux/" + Target.Architecture + "/";

                        PublicLibraryPaths.Add(LibraryPath);
                        PublicAdditionalLibraries.Add(LibraryName);
                    }
                }
                break;
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            // we don't bother with debug libraries on HTML5. Mainly because debugging isn't viable on html5 currently
            string StaticLibraryExtension = "bc";

            string[] LibraryNameStems =
            {
                "data",                 // Data
                "uc",                   // Unicode Common
                "i18n",                 // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };

            foreach (string Stem in LibraryNameStems)
            {
                string LibraryName = "libicu" + Stem + "." + StaticLibraryExtension;
                PublicAdditionalLibraries.Add(TargetSpecificPath + LibraryName);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            string   LibraryNamePrefix = "sicu";
            string[] LibraryNameStems  =
            {
                "dt",                   // Data
                "uc",                   // Unicode Common
                "in",                   // Internationalization
                "le",                   // Layout Engine
                "lx",                   // Layout Extensions
                "io"                    // Input/Output
            };
            string LibraryNamePostfix = (Target.Configuration == UnrealTargetConfiguration.Debug) ?
                                        "d" : string.Empty;
            string LibraryExtension = "lib";
            foreach (string Stem in LibraryNameStems)
            {
                string LibraryName = ICURootPath + "PS4/lib/" + LibraryNamePrefix + Stem + LibraryNamePostfix + "." + LibraryExtension;
                PublicAdditionalLibraries.Add(LibraryName);
            }
        }

        // common defines
        if ((Target.Platform == UnrealTargetPlatform.Win64) ||
            (Target.Platform == UnrealTargetPlatform.Win32) ||
            (Target.Platform == UnrealTargetPlatform.Linux) ||
            (Target.Platform == UnrealTargetPlatform.Android) ||
            (Target.Platform == UnrealTargetPlatform.Mac) ||
            (Target.Platform == UnrealTargetPlatform.IOS) ||
            (Target.Platform == UnrealTargetPlatform.PS4) ||
            (Target.Platform == UnrealTargetPlatform.HTML5))
        {
            // Definitions
            Definitions.Add("U_USING_ICU_NAMESPACE=0");              // Disables a using declaration for namespace "icu".
            Definitions.Add("U_STATIC_IMPLEMENTATION");              // Necessary for linking to ICU statically.
            Definitions.Add("U_NO_DEFAULT_INCLUDE_UTF_HEADERS=1");   // Disables unnecessary inclusion of headers - inclusions are for ease of use.
            Definitions.Add("UNISTR_FROM_CHAR_EXPLICIT=explicit");   // Makes UnicodeString constructors for ICU character types explicit.
            Definitions.Add("UNISTR_FROM_STRING_EXPLICIT=explicit"); // Makes UnicodeString constructors for "char"/ICU string types explicit.
            Definitions.Add("UCONFIG_NO_TRANSLITERATION=1");         // Disables declarations and compilation of unused ICU transliteration functionality.
        }

        if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            // Definitions
            Definitions.Add("ICU_NO_USER_DATA_OVERRIDE=1");
            Definitions.Add("U_PLATFORM=U_PF_ORBIS");
        }
    }
Example #27
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(Lib);
                }
            }
            else if (EngineMinorVersion == "22" || EngineMinorVersion == "23")
            {
                // for 4.22 and 4.23
                if (Target.Type == TargetType.Editor)
                {
                    PublicAdditionalLibraries.Add("websockets_static422.lib");
                    PublicAdditionalLibraries.Add("libeay32.lib");
                    PublicAdditionalLibraries.Add("ssleay32.lib");
                }
                else
                {
                    PublicAdditionalLibraries.Add("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" || EngineMinorVersion == "23")
            {
                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);
            }
        }
    }
Example #28
0
    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");
                PublicAdditionalShadowFiles.Add(Target.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/ios/Simulator/libpng152.a");
            }
            else
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/ios/Device");
                PublicAdditionalShadowFiles.Add(Target.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/ios/Device/libpng152.a");
            }

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

            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);
    }
    public FreeType2(TargetInfo Target)
    {
        Type = ModuleType.External;

        Definitions.Add("WITH_FREETYPE=1");

        string FreeType2Path;
        string FreeType2LibPath;

        if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64 ||
            (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32"))
        {
            FreeType2Path = UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.6/";
        }
        else
        {
            FreeType2Path = UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/";
        }

        FreeType2LibPath = FreeType2Path + "Lib/";

        PublicSystemIncludePaths.Add(FreeType2Path + "include");

        if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64 ||
            (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32"))
        {
            FreeType2LibPath += (Target.Platform == UnrealTargetPlatform.Win64) ? "Win64/" : "Win32/";
            FreeType2LibPath += "VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();

            PublicSystemIncludePaths.Add(FreeType2Path + "include");

            PublicLibraryPaths.Add(FreeType2LibPath);
            PublicAdditionalLibraries.Add("freetype26MT.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicAdditionalLibraries.Add(FreeType2LibPath + "Mac/libfreetype2412.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            if (Target.Architecture == "-simulator")
            {
                PublicLibraryPaths.Add(FreeType2LibPath + "ios/Simulator");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/Lib/ios/Simulator/libfreetype2412.a");
            }
            else
            {
                PublicLibraryPaths.Add(FreeType2LibPath + "ios/Device");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/Lib/ios/Device/libfreetype2412.a");
            }

            PublicAdditionalLibraries.Add("freetype2412");
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            // filtered out in the toolchain
            PublicLibraryPaths.Add(FreeType2LibPath + "Android/ARMv7");
            PublicLibraryPaths.Add(FreeType2LibPath + "Android/ARM64");
            PublicLibraryPaths.Add(FreeType2LibPath + "Android/x86");
            PublicLibraryPaths.Add(FreeType2LibPath + "Android/x64");

            PublicAdditionalLibraries.Add("freetype2412");
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.Type == TargetRules.TargetType.Server)
            {
                string Err = string.Format("{0} dedicated server is made to depend on {1}. We want to avoid this, please correct module dependencies.", Target.Platform.ToString(), this.ToString());
                System.Console.WriteLine(Err);
                throw new BuildException(Err);
            }

            if (Target.IsMonolithic)
            {
                PublicAdditionalLibraries.Add(FreeType2LibPath + "Linux/" + Target.Architecture + "/libfreetype2412.a");
            }
            else
            {
                PublicAdditionalLibraries.Add(FreeType2LibPath + "Linux/" + Target.Architecture + "/libfreetype2412_fPIC.a");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicLibraryPaths.Add(FreeType2Path + "Lib/HTML5");
            PublicAdditionalLibraries.Add(FreeType2Path + "Lib/HTML5/libfreetype2412.bc");
        }
    }
Example #30
0
    public UElibPNG(TargetInfo Target)
    {
        Type = ModuleType.External;

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

        PublicIncludePaths.Add(libPNGPath);

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

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

            string LibFileName = "libpng" + (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.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");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/ios/Simulator/libpng152.a");
            }
            else
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/ios/Device");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/ios/Device/libpng152.a");
            }

            PublicAdditionalLibraries.Add("png152");
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            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.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.Type == TargetRules.TargetType.Server)
            {
                string Err = string.Format("{0} dedicated server is made to depend on {1}. We want to avoid this, please correct module dependencies.", Target.Platform.ToString(), this.ToString());
                System.Console.WriteLine(Err);
                throw new BuildException(Err);
            }

            PublicAdditionalLibraries.Add(libPNGPath + "/lib/Linux/" + Target.Architecture + "/libpng.a");
        }
        else if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            PublicLibraryPaths.Add(libPNGPath + "/lib/HTML5");

            if (UEBuildConfiguration.bCompileForSize)
            {
                PublicAdditionalLibraries.Add(libPNGPath + "/lib/HTML5/libpng_Oz.bc");
            }
            else
            {
                PublicAdditionalLibraries.Add(libPNGPath + "/lib/HTML5/libpng.bc");
            }
        }
    }