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");
            }
        }
    }
Example #2
0
    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);
        }
        PublicLibraryPaths.Add(LibrariesPath);

        string galaxyDLLName;

        if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            galaxyDLLName = "Galaxy.dll";
            PublicDelayLoadDLLs.Add(galaxyDLLName);
            PublicAdditionalLibraries.Add("Galaxy.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            galaxyDLLName = "Galaxy64.dll";
            PublicDelayLoadDLLs.Add(galaxyDLLName);
            PublicAdditionalLibraries.Add("Galaxy64.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            galaxyDLLName = "libGalaxy.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
        {
            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));
    }
    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);
        }
        PublicLibraryPaths.Add(LibrariesPath);

        string galaxyDLLName;

        if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            galaxyDLLName = "Galaxy.dll";
            PublicDelayLoadDLLs.Add(galaxyDLLName);
            PublicAdditionalLibraries.Add("Galaxy.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            galaxyDLLName = "Galaxy64.dll";
            PublicDelayLoadDLLs.Add(galaxyDLLName);
            PublicAdditionalLibraries.Add("Galaxy64.lib");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            galaxyDLLName = "libGalaxy.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";
            PublicAdditionalLibraries.Add("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/
            PublicAdditionalLibraries.Add("delayimp.lib");
            PublicDelayLoadDLLs.Add(galaxyDLLName);
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            galaxyDLLName = "libGalaxy64.prx";
            PublicAdditionalLibraries.Add("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));
    }
    public Noesis(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string NoesisBasePath    = ModuleDirectory + "/NoesisSDK/";
        string NoesisIncludePath = NoesisBasePath + "Include/";

        PublicIncludePaths.Add(NoesisIncludePath);

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

        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");

            string BaseTargetPath;
            if (Target.LinkType == TargetLinkType.Monolithic)
            {
                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";

            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;
                }
            }
            if (Target.LinkType == TargetLinkType.Monolithic)
            {
                RuntimeDependencies.Add("$(ProjectDir)" + NoesisDllTargetPath);
            }
            else
            {
                RuntimeDependencies.Add("$(EngineDir)" + NoesisDllTargetPath);
            }
        }
        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");

            PublicAdditionalShadowFiles.Add(Path.Combine(NoesisLibPath, "libNoesis.a"));
        }
        else if (Target.Platform == UnrealTargetPlatform.Android)
        {
            string NoesisLibPath = NoesisBasePath + "Bin/android_arm/";
            PublicLibraryPaths.Add(NoesisLibPath);
            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");
        }
    }
    public WebSocket(ReadOnlyTargetRules Target) : base(Target)
    {
//        System.Console.WriteLine("--- ws --current platform =" + Target.Platform);
        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",
            "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");
            PrivateDependencyModuleNames.Add("zlib");
            PrivateDependencyModuleNames.Add("OpenSSL");
            PrivateIncludePaths.Add("WebSocket/ThirdParty/include/Win64");

            foreach (string tmpP in PrivateIncludePaths)
            {
//                System.Console.WriteLine("--ws --" + tmpP);
            }

            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");
            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);
            }
        }
    }
    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 (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/";

        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" + 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",
                "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",
                "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 + "/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}",
                //"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[] StaticLibrariesPhysXLinux = new string[] {
                "rt",
                "LowLevel{0}",
                "LowLevelAABB{0}",
                "LowLevelCloth{0}",
                "LowLevelDynamics{0}",
                "LowLevelParticles{0}",
                "PhysX3{0}",
                "PhysX3Extensions{0}",
                "PhysX3Cooking{0}",
                "PhysX3Common{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
                "PxFoundation{0}",
                "PxTask{0}",
                "PxPvdSDK{0}",
                "PsFastXml{0}"
            };

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

            if (UEBuildConfiguration.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 (UEBuildConfiguration.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)
        {
            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",
                "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", // not needed until Apex
                "PhysX3Extensions",
                "SceneQuery",
                "SimulationController",
                "PxFoundation",
                "PxTask",
                "PxPvdSDK",
                "PsFastXml"
            };

            foreach (string Lib in StaticLibrariesSwitch)
            {
                PublicAdditionalLibraries.Add(Lib + LibrarySuffix);
            }
        }
    }
Example #7
0
    public FreeType2(ReadOnlyTargetRules Target) : base(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.Linux ||
            Target.Platform == UnrealTargetPlatform.HTML5)
        {
            FreeType2Path = UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.6/";

            PublicSystemIncludePaths.Add(FreeType2Path + "Include");
        }
        else
        {
            FreeType2Path = UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/";

            PublicSystemIncludePaths.Add(FreeType2Path + "include");
        }

        FreeType2LibPath = FreeType2Path + "Lib/";

        if (Target.Platform == UnrealTargetPlatform.Win32 ||
            Target.Platform == UnrealTargetPlatform.Win64 ||
            (Target.Platform == UnrealTargetPlatform.HTML5 && Target.Architecture == "-win32") // simulator
            )
        {
            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.TVOS)
        {
            if (Target.Architecture == "-simulator")
            {
                PublicLibraryPaths.Add(FreeType2LibPath + "TVOS/Simulator");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/Lib/TVOS/Simulator/libfreetype2412.a");
            }
            else
            {
                PublicLibraryPaths.Add(FreeType2LibPath + "TVOS/Device");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/Lib/TVOS/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 == 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 (UEBuildConfiguration.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("freetype2412");
        }
        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("freetype2412.lib");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            PublicAdditionalLibraries.Add(System.IO.Path.Combine(FreeType2LibPath, "Switch/libFreetype.a"));
        }
    }
Example #8
0
    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.WolfPlat)
        {
            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 + "WolfPlat/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.WolfPlat)
            )
        {
            // 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 #9
0
    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.Switch:
            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));

        if (Target.Platform != UnrealTargetPlatform.Switch)
        {
            PublicDependencyModuleNames.Add("OpenSSL");
        }
    }
Example #10
0
	public UElibPNG(TargetInfo Target)
	{
		Type = ModuleType.External;

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

		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") // simulator
		)
		{
			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.TVOS)
		{
			if (Target.Architecture == "-simulator")
			{
				PublicLibraryPaths.Add(libPNGPath + "/lib/TVOS/Simulator");
				PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/TVOS/Simulator/libpng152.a");
			}
			else
			{
				PublicLibraryPaths.Add(libPNGPath + "/lib/TVOS/Device");
				PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/TVOS/Device/libpng152.a");
			}

			PublicAdditionalLibraries.Add("png152");
		}
		else if (Target.Platform == UnrealTargetPlatform.Android)
		{
			libPNGPath = UEBuildConfiguration.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.Platform == UnrealTargetPlatform.Linux)
		{
			PublicAdditionalLibraries.Add(libPNGPath + "/lib/Linux/" + Target.Architecture + "/libpng.a");
		}
		else if (Target.Platform == UnrealTargetPlatform.HTML5)
		{
			PublicLibraryPaths.Add(libPNGPath + "/lib/HTML5");
			string OpimizationSuffix = "";
			if (UEBuildConfiguration.bCompileForSize)
			{
				OpimizationSuffix = "_Oz";
			}
			else
			{
				if (Target.Configuration == UnrealTargetConfiguration.Development)
				{
					OpimizationSuffix = "_O2";
				}
				else if (Target.Configuration == UnrealTargetConfiguration.Shipping)
				{
					OpimizationSuffix = "_O3";
				}
			}
			PublicAdditionalLibraries.Add(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.WolfPlat)
		{
			PublicAdditionalLibraries.Add(System.IO.Path.Combine(libPNGPath, "lib/WolfPlat/libPNG.a"));
		}

		PublicIncludePaths.Add(libPNGPath);
	}
    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")
            {
                // for 4.22
                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")
            {
                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[] StaticLibrariesAndroid = new string[] {
                "websockets",
                //"ssl",
                //"crypto"
            };

            foreach (string Lib in StaticLibrariesAndroid)
            {
                PublicAdditionalLibraries.Add(Lib);
            }
        }
    }
Example #12
0
    public AdMob(ReadOnlyTargetRules Target) : base(Target)
    {
        string strEngineDir     = GetEngineDirectory();
        string strEngineVersion = ReadEngineVersion(strEngineDir);

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

        PublicIncludePaths.AddRange(
            new string[] {
            "AdMob/Public"

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

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

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


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

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


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


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

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

            PublicLibraryPaths.Add(strStaticPath);

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

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


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

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


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


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

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


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


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

            PublicAdditionalLibraries.Add("VungleAdapter");
            PublicAdditionalShadowFiles.Add(strStaticPath + "libVungleAdapter.a");


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

            string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);

            if (EngineMinorVersion == "18")
            {
                AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", Path.Combine(PluginPath, "AdMob418_UPL.xml")));
            }
            else
            {
                AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", Path.Combine(PluginPath, "AdMob_UPL.xml")));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)
        {
            PrivateIncludePaths.Add("Private/Windows");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            PrivateIncludePaths.Add("Private/Mac");
        }
        else
        {
            PrecompileForTargets = PrecompileTargetsType.None;
        }
    }
Example #13
0
    public FreeType2(TargetInfo Target)
    {
        Type = ModuleType.External;

        Definitions.Add("WITH_FREETYPE=1");

        string FreeType2Path = UEBuildConfiguration.UEThirdPartySourceDirectory + "FreeType2/FreeType2-2.4.12/";

        PublicSystemIncludePaths.Add(FreeType2Path + "include");

        string FreeType2LibPath = FreeType2Path + "Lib/";

        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();

            PublicLibraryPaths.Add(FreeType2LibPath);
            PublicAdditionalLibraries.Add("freetype2412MT.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 #14
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 + LibraryNamePostfix + ".53.1" + "." + 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");
        }
    }
    public Steamworks(TargetInfo Target)
    {
        /** Mark the current version of the Steam SDK */
        string SteamVersion = "v132";

        Type = ModuleType.External;

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

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

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

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

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

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

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

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

            if (Target.Type == TargetRules.TargetType.Server)
            {
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "steamclient64.dll"));
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "tier0_s64.dll"));
                RuntimeDependencies.Add(new RuntimeDependency(SteamBinariesDir + "vstdlib_s64.dll"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            LibraryPath += "osx32/libsteam_api.dylib";
            PublicDelayLoadDLLs.Add(LibraryPath);
            PublicAdditionalShadowFiles.Add(LibraryPath);
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.IsMonolithic)
            {
                LibraryPath += "linux64";
                PublicLibraryPaths.Add(LibraryPath);
                PublicAdditionalLibraries.Add(LibraryName);
            }
            else
            {
                LibraryPath += "linux64/libsteam_api.so";
                PublicDelayLoadDLLs.Add(LibraryPath);
            }
        }
    }
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") // simulator
                 )
        {
            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.TVOS)
        {
            if (Target.Architecture == "-simulator")
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/TVOS/Simulator");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/TVOS/Simulator/libpng152.a");
            }
            else
            {
                PublicLibraryPaths.Add(libPNGPath + "/lib/TVOS/Device");
                PublicAdditionalShadowFiles.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "libPNG/libPNG-1.5.2/lib/TVOS/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");
            string OpimizationSuffix = "";
            if (UEBuildConfiguration.bCompileForSize)
            {
                OpimizationSuffix = "_Oz";
            }
            else
            {
                if (Target.Configuration == UnrealTargetConfiguration.Development)
                {
                    OpimizationSuffix = "_O2";
                }
                else if (Target.Configuration == UnrealTargetConfiguration.Shipping)
                {
                    OpimizationSuffix = "_O3";
                }
            }
            PublicAdditionalLibraries.Add(libPNGPath + "/lib/HTML5/libpng" + OpimizationSuffix + ".bc");
        }
    }