Example #1
0
    public UnLua(ReadOnlyTargetRules Target) : base(Target)
    {
        bEnforceIWYU = false;

        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

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


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


        PublicIncludePathModuleNames.AddRange(
            new string[] {
            "ApplicationCore",
            "Lua",
            "LuaLibFeature"
        }
            );


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


        if (Target.bBuildEditor == true)
        {
            PrivateDependencyModuleNames.Add("UnrealEd");
        }

        bool bAutoStartup = true;

        if (bAutoStartup)
        {
            PublicDefinitions.Add("AUTO_UNLUA_STARTUP=1");
        }

        bool bWithUE4Namespace = false;

        if (bWithUE4Namespace)
        {
            PublicDefinitions.Add("WITH_UE4_NAMESPACE=1");
        }

        bool bSupportsRpcCall = false;

        if (bSupportsRpcCall)
        {
            PublicDefinitions.Add("SUPPORTS_RPC_CALL=1");
        }

        string[] EnableLibs =
        {
            "LibLuasocket",
            "LuaPanda",
            "LuaProtobuf"
        };
        // combine all enabled libs as LUA_LIBS macro
        {
            string EnabledLuaLibMacro = "LUA_LIBS=\"";
            foreach (var Lib in EnableLibs)
            {
                DynamicallyLoadedModuleNames.Add(Lib);
                EnabledLuaLibMacro += Lib + ";";
            }

            EnabledLuaLibMacro += "\"";

            PublicDefinitions.Add(EnabledLuaLibMacro);
        }

        bool   EnableAllRegistedLuaLibs       = false;
        string EnableAllRegistedLualibsMacrro = "ENABLE_ALL_REGISTED_LUA_LIB=" + (EnableAllRegistedLuaLibs ? "1" : "0");

        PublicDefinitions.Add(EnableAllRegistedLualibsMacrro);
        OptimizeCode = CodeOptimization.InShippingBuildsOnly;
    }
Example #2
0
    public AlembicLib(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;
        if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32 ||
            Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux)
        {
            bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT);

            string LibDir = ModuleDirectory + "/AlembicDeploy/";
            string Platform;
            bool   bAllowDynamicLibs = true;
            if (Target.Platform == UnrealTargetPlatform.Win64)
            {
                Platform = "x64";
                LibDir  += "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName() + "/";
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                Platform          = "Mac";
                bAllowDynamicLibs = false;
            }
            else if (Target.Platform == UnrealTargetPlatform.Linux)
            {
                Platform          = "Linux";
                bAllowDynamicLibs = false;
            }
            else
            {
                // unsupported
                return;
            }
            LibDir = LibDir + "/" + Platform + "/lib/";
            PublicLibraryPaths.Add(LibDir);

            string LibPostFix   = bDebug && bAllowDynamicLibs ? "d" : "";
            string LibExtension = (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux) ? ".a" : ".lib";

            if (Target.Platform == UnrealTargetPlatform.Win64)
            {
                PublicDefinitions.Add("H5_BUILT_AS_DYNAMIC_LIB");
                PublicDefinitions.Add("OPENEXR_DLL");

                List <string> ReqLibraryNames = new List <string>();
                ReqLibraryNames.AddRange
                (
                    new string[] {
                    "Half",
                    "Iex",
                    "IlmThread",
                    "Imath",
                    "IexMath",
                    (bDebug && bAllowDynamicLibs) ? "hdf5_" : "hdf5",
                    "Alembic"
                });
                foreach (string LibraryName in ReqLibraryNames)
                {
                    PublicAdditionalLibraries.Add(LibraryName + LibPostFix + LibExtension);
                }

                if (Target.bDebugBuildsActuallyUseDebugCRT && bDebug)
                {
                    RuntimeDependencies.Add("$(EngineDir)/Plugins/Experimental/AlembicImporter/Binaries/Win64/zlibd1.dll");
                    RuntimeDependencies.Add("$(EngineDir)/Plugins/Experimental/AlembicImporter/Binaries/Win64/hdf5_D.dll");
                }
                else
                {
                    RuntimeDependencies.Add("$(EngineDir)/Plugins/Experimental/AlembicImporter/Binaries/Win64/hdf5.dll");
                }
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                List <string> ReqLibraryNames = new List <string>();
                ReqLibraryNames.AddRange
                (
                    new string[] {
                    "libHalf",
                    "libIex",
                    "libIlmThread",
                    "libImath",
                    (bDebug && bAllowDynamicLibs) ? "hdf5_" : "hdf5",
                    "libAlembic"
                });

                foreach (string LibraryName in ReqLibraryNames)
                {
                    PublicAdditionalLibraries.Add(LibDir + LibraryName + LibPostFix + LibExtension);
                }
            }
            else if (Target.Platform == UnrealTargetPlatform.Linux)
            {
                List <string> ReqLibraryNames = new List <string>();
                ReqLibraryNames.AddRange
                (
                    new string[] {
                    "libHalf",
                    "libIex",
                    "libIlmThread",
                    "libImath",
                    "hdf5",
                    "libAlembic"
                });

                foreach (string LibraryName in ReqLibraryNames)
                {
                    PublicAdditionalLibraries.Add(LibDir + Target.Architecture + "/" + LibraryName + LibExtension);
                }
            }

            PublicIncludePaths.Add(ModuleDirectory + "/AlembicDeploy/include/");
            PublicIncludePaths.Add(ModuleDirectory + "/AlembicDeploy/include/OpenEXR/");
        }
    }
        public WindowsMixedRealityHMD(ReadOnlyTargetRules Target) : base(Target)
        {
            bEnableExceptions = true;

            if (Target.Platform == UnrealTargetPlatform.Win32 ||
                Target.Platform == UnrealTargetPlatform.Win64 ||
                Target.Platform == UnrealTargetPlatform.HoloLens)
            {
                PublicDependencyModuleNames.AddRange(
                    new string[]
                {
                    "HeadMountedDisplay",
                    "ProceduralMeshComponent",
                    "MixedRealityInteropLibrary",
                    "InputDevice",
                }
                    );

                PrivateDependencyModuleNames.AddRange(
                    new string[]
                {
                    "Core",
                    "CoreUObject",
                    "ApplicationCore",
                    "Engine",
                    "InputCore",
                    "RHI",
                    "RenderCore",
                    "Renderer",
                    "HeadMountedDisplay",
                    "D3D11RHI",
                    "Slate",
                    "SlateCore",
                    "UtilityShaders",
                    "Projects",
                    "WindowsMixedRealityHandTracking",
                    "AugmentedReality",
                }
                    );

                if (Target.Platform == UnrealTargetPlatform.Win64 ||
                    Target.Platform == UnrealTargetPlatform.HoloLens)
                {
                    PrivateDependencyModuleNames.Add("HoloLensAR");
                }

                if (Target.bBuildEditor == true)
                {
                    PrivateDependencyModuleNames.Add("UnrealEd");
                }

                if (Target.Platform != UnrealTargetPlatform.HoloLens)
                {
                    AddEngineThirdPartyPrivateStaticDependencies(Target, "NVAftermath");
                    AddEngineThirdPartyPrivateStaticDependencies(Target, "IntelMetricsDiscovery");
                }

                AddEngineThirdPartyPrivateStaticDependencies(Target, "WindowsMixedRealityInterop");

                LoadMixedReality(Target);

                PrivateIncludePaths.AddRange(
                    new string[]
                {
                    "WindowsMixedRealityHMD/Private",
                    "../../../../Source/Runtime/Windows/D3D11RHI/Private",
                    "../../../../Source/Runtime/Renderer/Private",
                });

                if (Target.Platform == UnrealTargetPlatform.Win32 ||
                    Target.Platform == UnrealTargetPlatform.Win64)
                {
                    PrivateIncludePaths.Add("../../../../Source/Runtime/Windows/D3D11RHI/Private/Windows");
                }
                else if (Target.Platform == UnrealTargetPlatform.HoloLens)
                {
                    PrivateIncludePaths.Add("../../../../Source/Runtime/Windows/D3D11RHI/Private/HoloLens");
                }

                bFasterWithoutUnity = true;

                PCHUsage             = PCHUsageMode.NoSharedPCHs;
                PrivatePCHHeaderFile = "Private/WindowsMixedRealityPrecompiled.h";
            }

            if (Target.Platform == UnrealTargetPlatform.Win64 || (Target.Platform == UnrealTargetPlatform.HoloLens && Target.WindowsPlatform.Architecture == WindowsArchitecture.x64))
            {
                PublicDelayLoadDLLs.Add("QRCodesTrackerPlugin.dll");
                RuntimeDependencies.Add(Path.Combine("$(EngineDir)/Binaries/ThirdParty/Windows/x64", "QRCodesTrackerPlugin.dll"));
            }
            else if (Target.Platform == UnrealTargetPlatform.HoloLens)
            {
                PublicDelayLoadDLLs.Add("QRCodesTrackerPlugin.dll");
                RuntimeDependencies.Add(Path.Combine("$(EngineDir)/Binaries/ThirdParty/HoloLens/ARM64", "QRCodesTrackerPlugin.dll"));
            }

            // Add a dependency to SceneUnderstanding.dll if present
            string SceneUnderstandingPath = Path.Combine(Target.UEThirdPartyBinariesDirectory, "HoloLens", Target.WindowsPlatform.GetArchitectureSubpath(), "SceneUnderstanding.dll");

            if (File.Exists(SceneUnderstandingPath))
            {
                PublicDelayLoadDLLs.Add("SceneUnderstanding.dll");
                RuntimeDependencies.Add(SceneUnderstandingPath);
                PublicDefinitions.Add("WITH_SCENE_UNDERSTANDING=1");
            }
            else
            {
                PublicDefinitions.Add("WITH_SCENE_UNDERSTANDING=0");
            }
        }
Example #4
0
    public UnrealEnginePython(TargetInfo Target)
#endif
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
        PublicDefinitions.Add("WITH_UNREALENGINEPYTHON=1"); // fixed
        string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");

        bUseUnity = string.IsNullOrEmpty(enableUnityBuild);

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


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


        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "Sockets",
            "Networking",
            // ... add other public dependencies that you statically link with here ...
            // Extra Dependencies for USDImporter Plugin
            "GeometryCacheUSD",
            "UnrealUSDWrapper",
            "USDClasses",
            "USDExporter",
            "USDImporter",
            "USDSchemas",
            "USDStage",
            "USDStageEditor",
            "USDStageEditorViewModels",
            "USDStageImporter",
            "USDUtilities",
        }
            );


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "CoreUObject",
            "Engine",
            "InputCore",
            "Slate",
            "SlateCore",
            "MovieScene",
            "LevelSequence",
            "HTTP",
            "UMG",
            "AppFramework",
            "RHI",
            "Voice",
            "RenderCore",
            "MovieSceneCapture",
            "Landscape",
            "Foliage",
            "AIModule",
            // ... add private dependencies that you statically link with here ...
            // Extra Dependencies for USDImporter Plugin
            "GeometryCacheUSD",
            "UnrealUSDWrapper",
            "USDClasses",
            "USDExporter",
            "USDImporter",
            "USDSchemas",
            "USDStage",
            "USDStageEditor",
            "USDStageEditorViewModels",
            "USDStageImporter",
            "USDUtilities",
        }
            );


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


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

#if WITH_FORWARDED_MODULE_RULES_CTOR
        if (Target.bBuildEditor)
#else
        if (UEBuildConfiguration.bBuildEditor)
#endif
        {
            PublicIncludePaths.AddRange(
                new string[] {
                "Editor/Sequencer/Private",
            }
                );

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

            PrivateDependencyModuleNames.AddRange(new string[] {
                "UnrealEd",
                "LevelEditor",
                "BlueprintGraph",
                "Projects",
                "Sequencer",
                "SequencerWidgets",
                "AssetTools",
                "LevelSequenceEditor",
                "MovieSceneTools",
                "MovieSceneTracks",
                "CinematicCamera",
                "EditorStyle",
                "GraphEditor",
                "UMGEditor",
                "AIGraph",
                "RawMesh",
                "DesktopWidgets",
                "EditorWidgets",
                "FBX",
                "Persona",
                "PropertyEditor",
                "LandscapeEditor",
                "MaterialEditor",
                // Extra Dependencies for USDImporter Plugin
                "GeometryCacheUSD",
                "UnrealUSDWrapper",
                "USDClasses",
                "USDExporter",
                "USDImporter",
                "USDSchemas",
                "USDStage",
                "USDStageEditor",
                "USDStageEditorViewModels",
                "USDStageImporter",
                "USDUtilities",
            });
            if (Version.MinorVersion > 21)
            {
                PrivateDependencyModuleNames.Add("MeshDescription");
                PrivateDependencyModuleNames.Add("StaticMeshDescription");
            }
        }

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

            string APLName    = "UnrealEnginePython_APL.xml";
            string RelAPLPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
            AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(RelAPLPath, APLName));
        }
#endif
    }
    public SlateReflector(ReadOnlyTargetRules Target) : base(Target)
    {
        PublicDependencyModuleNames.AddRange(
            new string[] {
            "Core",
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[] {
            "CoreUObject",
            "ApplicationCore",
            "InputCore",
            "Slate",
            "SlateCore",
            "EditorStyle",
            "Json",
            "AssetRegistry",
            "MessageLog"
        }
            );

        PrivateIncludePathModuleNames.AddRange(
            new string[] {
            "Messaging",
            "MessagingCommon",
        }
            );

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

        PrivateIncludePaths.AddRange(
            new string[] {
            "Developer/SlateReflector/Private",
            "Developer/SlateReflector/Private/Models",
            "Developer/SlateReflector/Private/Widgets",
        }
            );

        // Editor builds include SessionServices to populate the remote target drop-down for remote widget snapshots
        if (Target.Type == TargetType.Editor)
        {
            PublicDefinitions.Add("SLATE_REFLECTOR_HAS_SESSION_SERVICES=1");

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

            PrivateIncludePathModuleNames.AddRange(
                new string[] {
                "SessionServices",
            }
                );

            DynamicallyLoadedModuleNames.AddRange(
                new string[] {
                "SessionServices",
            }
                );
        }
        else
        {
            PublicDefinitions.Add("SLATE_REFLECTOR_HAS_SESSION_SERVICES=0");
        }

        // DesktopPlatform is only available for Editor and Program targets (running on a desktop platform)
        bool IsDesktopPlatformType = Target.Platform == UnrealBuildTool.UnrealTargetPlatform.Win32 ||
                                     Target.Platform == UnrealBuildTool.UnrealTargetPlatform.Win64 ||
                                     Target.Platform == UnrealBuildTool.UnrealTargetPlatform.Mac ||
                                     Target.Platform == UnrealBuildTool.UnrealTargetPlatform.Linux;

        if (Target.Type == TargetType.Editor || (Target.Type == TargetType.Program && IsDesktopPlatformType))
        {
            PublicDefinitions.Add("SLATE_REFLECTOR_HAS_DESKTOP_PLATFORM=1");

            PrivateDependencyModuleNames.AddRange(
                new string[] {
                "DesktopPlatform",
            }
                );
        }
        else
        {
            PublicDefinitions.Add("SLATE_REFLECTOR_HAS_DESKTOP_PLATFORM=0");
        }

        if (Target.Configuration != UnrealTargetConfiguration.Shipping)
        {
            PrecompileForTargets = PrecompileTargetsType.Any;
        }
    }
Example #6
0
    public HoudiniEngineRuntime(ReadOnlyTargetRules Target) : base(Target)
    {
        bPrecompile          = true;
        PCHUsage             = PCHUsageMode.UseSharedPCHs;
        PrivatePCHHeaderFile = "Private/HoudiniEngineRuntimePrivatePCH.h";

        // Check if we are compiling for unsupported platforms.
        if (Target.Platform != UnrealTargetPlatform.Win64 &&
            Target.Platform != UnrealTargetPlatform.Mac &&
            Target.Platform != UnrealTargetPlatform.Linux &&
            Target.Platform != UnrealTargetPlatform.Switch)
        {
            System.Console.WriteLine(string.Format("Houdini Engine: Compiling for untested target platform.  Please let us know how it goes!"));
        }

        // Find HFS
        string HFSPath = GetHFSPath();

        HFSPath = HFSPath.Replace("\\", "/");

        if (HFSPath != "")
        {
            string Log = string.Format("Houdini Engine: Found Houdini in {0}", HFSPath);
            System.Console.WriteLine(Log);

            PlatformID buildPlatformId = Environment.OSVersion.Platform;
            if (buildPlatformId == PlatformID.Win32NT)
            {
                PublicDefinitions.Add("HOUDINI_ENGINE_HFS_PATH_DEFINE=" + HFSPath);
            }
        }

        // Find the HAPI include directory
        string HAPIIncludePath = HFSPath + "/toolkit/include/HAPI";

        if (!Directory.Exists(HAPIIncludePath))
        {
            // Add the custom include path as well in case the toolkit path doesn't exist yet.
            HAPIIncludePath = HFSPath + "/custom/houdini/include/HAPI";

            if (!Directory.Exists(HAPIIncludePath))
            {
                System.Console.WriteLine(string.Format("Couldn't find the HAPI include folder!"));
                HAPIIncludePath = "";
            }
        }

        if (HAPIIncludePath != "")
        {
            PublicIncludePaths.Add(HAPIIncludePath);
        }

        PublicIncludePaths.AddRange(
            new string[] {
            Path.Combine(ModuleDirectory, "Public/HAPI"),
            Path.Combine(ModuleDirectory, "Public")
        }
            );

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

        // Add common dependencies.
        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "CoreUObject",
            "Engine",
            "RenderCore",
            "InputCore",
            "RHI",
            "Foliage",
            "Landscape"
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            // ... add private dependencies that you statically link with here ...
        }
            );

        if (Target.bBuildEditor == true)
        {
            PrivateDependencyModuleNames.AddRange(
                new string[]
            {
                "AppFramework",
                "AssetTools",
                "EditorStyle",
                "EditorWidgets",
                "LevelEditor",
                "MainFrame",
                "MeshPaint",
                "Projects",
                "PropertyEditor",
                "RawMesh",
                "Settings",
                "Slate",
                "SlateCore",
                "TargetPlatform",
                "UnrealEd",
                "ApplicationCore",
                "Landscape",
                "LandscapeEditor"
            }
                );
        }

        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
        }
            );
    }
Example #7
0
    public TeamSpeak_SDK(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

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

        PublicIncludePaths.AddRange(
            new string[] {
            Path.Combine(ModuleDirectory, "Public"),
            Path.Combine(SDKDirectory, "include")
        }
            );

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

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

        if (bHasTeamspeakSDK)
        {
            PublicDefinitions.Add("WITH_TEAMSPEAK=1");
            if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32)
            {
                // Add the import library
                string platform     = Target.Platform == UnrealTargetPlatform.Win32 ? "win32" : "win64";
                string LibDirectory = Path.Combine(SDKDirectory, "lib", "windows", platform);

                PublicLibraryPaths.Add(LibDirectory);
                PublicAdditionalLibraries.Add("ts3client.lib");

                string SDKLibWindows = Path.Combine(SDKDirectory, "bin", "windows", platform, "ts3client.dll");

                string binariesDir = Path.Combine(BaseDirectory, "Binaries", Target.Platform.ToString());
                string filename    = "ts3client.dll";

                if (!Directory.Exists(binariesDir))
                {
                    Directory.CreateDirectory(binariesDir);
                }

                string binPath = Path.Combine(binariesDir, filename);
                if (!File.Exists(Path.Combine(binariesDir, filename)))
                {
                    File.Copy(SDKLibWindows, binPath, true);
                }

                RuntimeDependencies.Add(binPath);
            }
            else if (Target.Platform == UnrealTargetPlatform.Linux)
            {
                string binariesDir = Path.Combine(BaseDirectory, "Binaries", Target.Platform.ToString());
                string filename    = "libts3client.so";
                string binPath     = Path.Combine(binariesDir, filename);
                string SDKLibLinux = Path.Combine(SDKDirectory, "bin", "linux", "amd64", filename);

                if (!Directory.Exists(binariesDir))
                {
                    Directory.CreateDirectory(binariesDir);
                }

                if (!File.Exists(Path.Combine(binPath)))
                {
                    File.Copy(SDKLibLinux, binPath, true);
                }

                RuntimeDependencies.Add(binPath);
                PublicAdditionalLibraries.Add(Path.Combine(SDKDirectory, "bin", "linux", "amd64", "libts3client.so"));
            }
        }
        else
        {
            PublicDefinitions.Add("WITH_TEAMSPEAK=0");
        }
    }
    public AWSCore(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private"));
        PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public"));

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

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

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

        if (bIsThirdPartyPathValid)
        {
            if (Target.Type == TargetRules.TargetType.Client)
            {
                if (!Directory.Exists(BinariesDirectory))
                {
                    Directory.CreateDirectory(BinariesDirectory);
                }

                PublicDefinitions.Add("WITH_AWSCORE=1");
                //PublicLibraryPaths.Add(ThirdPartyPath);
                if (Target.Platform == UnrealTargetPlatform.Linux)
                {
                    // dependencies
                    string CommonSoFile = System.IO.Path.Combine(ThirdPartyPath, "libaws-c-common.so");
                    if (File.Exists(CommonSoFile))
                    {
                        PublicAdditionalLibraries.Add(CommonSoFile);
                        RuntimeDependencies.Add(CommonSoFile);
                    }
                    else
                    {
                        throw new BuildException("libaws-c-common.so not found. Expected in this location: " + CommonSoFile);
                    }

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

                    string ChecksumsSoFile = System.IO.Path.Combine(ThirdPartyPath, "libaws-checksums.so");
                    if (File.Exists(ChecksumsSoFile))
                    {
                        PublicAdditionalLibraries.Add(ChecksumsSoFile);
                        RuntimeDependencies.Add(ChecksumsSoFile);
                    }
                    else
                    {
                        throw new BuildException("libaws-checksums.so not found. Expected in this location: " + ChecksumsSoFile);
                    }

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

                    // binaries
                    if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "libaws-c-common.so")) == false)
                    {
                        File.Copy(System.IO.Path.Combine(ThirdPartyPath, "libaws-c-common.so"), System.IO.Path.Combine(BinariesDirectory, "libaws-c-common.so"));
                    }
                    if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "libaws-c-event-stream.so")) == false)
                    {
                        File.Copy(System.IO.Path.Combine(ThirdPartyPath, "libaws-c-event-stream.so"), System.IO.Path.Combine(BinariesDirectory, "libaws-c-event-stream.so"));
                    }
                    if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "libaws-checksums.so")) == false)
                    {
                        File.Copy(System.IO.Path.Combine(ThirdPartyPath, "libaws-checksums.so"), System.IO.Path.Combine(BinariesDirectory, "libaws-checksums.so"));
                    }
                    if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "libaws-cpp-sdk-core.so")) == false)
                    {
                        File.Copy(System.IO.Path.Combine(ThirdPartyPath, "libaws-cpp-sdk-core.so"), System.IO.Path.Combine(BinariesDirectory, "libaws-cpp-sdk-core.so"));
                    }
                }
                else if (Target.Platform == UnrealTargetPlatform.Win64)
                {
                    // dependencies
                    string CommonLibFile = System.IO.Path.Combine(ThirdPartyPath, "aws-c-common.lib");
                    if (File.Exists(CommonLibFile))
                    {
                        PublicAdditionalLibraries.Add(CommonLibFile);
                    }
                    else
                    {
                        throw new BuildException("aws-c-common.lib not found. Expected in this location: " + CommonLibFile);
                    }

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

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

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

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

                    string ChecksumsDLLFile = System.IO.Path.Combine(ThirdPartyPath, "aws-checksums.dll");
                    if (File.Exists(ChecksumsDLLFile))
                    {
                        PublicDelayLoadDLLs.Add("aws-checksums.dll");
                        RuntimeDependencies.Add(ChecksumsDLLFile);
                    }
                    else
                    {
                        throw new BuildException("aws-checksums.dll not found. Expected in this location: " + ChecksumsDLLFile);
                    }

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

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

                    // binaries
                    if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "aws-c-common.dll")) == false)
                    {
                        File.Copy(System.IO.Path.Combine(ThirdPartyPath, "aws-c-common.dll"), System.IO.Path.Combine(BinariesDirectory, "aws-c-common.dll"));
                    }
                    if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "aws-c-event-stream.dll")) == false)
                    {
                        File.Copy(System.IO.Path.Combine(ThirdPartyPath, "aws-c-event-stream.dll"), System.IO.Path.Combine(BinariesDirectory, "aws-c-event-stream.dll"));
                    }
                    if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "aws-checksums.dll")) == false)
                    {
                        File.Copy(System.IO.Path.Combine(ThirdPartyPath, "aws-checksums.dll"), System.IO.Path.Combine(BinariesDirectory, "aws-checksums.dll"));
                    }
                    if (File.Exists(System.IO.Path.Combine(BinariesDirectory, "aws-cpp-sdk-core.dll")) == false)
                    {
                        File.Copy(System.IO.Path.Combine(ThirdPartyPath, "aws-cpp-sdk-core.dll"), System.IO.Path.Combine(BinariesDirectory, "aws-cpp-sdk-core.dll"));
                    }
                }
            }
            else
            {
                PublicDefinitions.Add("WITH_AWSCORE=0");
            }
        }
        else
        {
            PublicDefinitions.Add("WITH_AWSCORE=0");
        }
    }
Example #9
0
        public AIModule(ReadOnlyTargetRules Target) : base(Target)
        {
            PublicIncludePaths.AddRange(
                new string[] {
                "Runtime/NavigationSystem/Public",
                "Runtime/AIModule/Public",
            }
                );

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

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

            PrivateDependencyModuleNames.AddRange(
                new string[] {
                "RHI",
                "RenderCore",
            }
                );

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

            if (Target.bBuildEditor == true)
            {
                PrivateDependencyModuleNames.Add("UnrealEd");

                PrivateDependencyModuleNames.Add("AITestSuite");
                CircularlyReferencedDependentModules.Add("AITestSuite");
            }

            if (Target.bCompileRecast)
            {
                PrivateDependencyModuleNames.Add("Navmesh");
                PublicDefinitions.Add("WITH_RECAST=1");
            }
            else
            {
                // Because we test WITH_RECAST in public Engine header files, we need to make sure that modules
                // that import us also have this definition set appropriately.  Recast is a private dependency
                // module, so it's definitions won't propagate to modules that import Engine.
                PublicDefinitions.Add("WITH_RECAST=0");
            }

            if (Target.bBuildDeveloperTools || (Target.Configuration != UnrealTargetConfiguration.Shipping && Target.Configuration != UnrealTargetConfiguration.Test))
            {
                PrivateDependencyModuleNames.Add("GameplayDebugger");
                PublicDefinitions.Add("WITH_GAMEPLAY_DEBUGGER=1");
            }
            else
            {
                PublicDefinitions.Add("WITH_GAMEPLAY_DEBUGGER=0");
            }
        }
Example #10
0
    public Core(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivatePCHHeaderFile = "Private/CorePrivatePCH.h";

        SharedPCHHeaderFile = "Public/CoreSharedPCH.h";

        PrivateDependencyModuleNames.Add("BuildSettings");

        PublicDependencyModuleNames.Add("TraceLog");
        PublicIncludePaths.Add("Runtime/TraceLog/Public");

        PrivateIncludePaths.AddRange(
            new string[] {
            "Developer/DerivedDataCache/Public",
            "Runtime/SynthBenchmark/Public",
            "Runtime/Core/Private",
            "Runtime/Core/Private/Misc",
            "Runtime/Core/Private/Internationalization",
            "Runtime/Core/Private/Internationalization/Cultures",
            "Runtime/Engine/Public",
        }
            );

        PrivateIncludePathModuleNames.AddRange(
            new string[] {
            "TargetPlatform",
            "DerivedDataCache",
            "InputDevice",
            "Analytics",
            "RHI"
        }
            );

        if (Target.bBuildEditor == true)
        {
            DynamicallyLoadedModuleNames.Add("SourceCodeAccess");

            PrivateIncludePathModuleNames.Add("DirectoryWatcher");
            DynamicallyLoadedModuleNames.Add("DirectoryWatcher");
        }

        if (Target.Platform.IsInGroup(UnrealPlatformGroup.Windows))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "zlib");

            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "IntelTBB",
                                                         "IntelVTune"
                                                         );

            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "mimalloc");

            if (Target.Platform != UnrealTargetPlatform.Win32 && Target.WindowsPlatform.bUseBundledDbgHelp)
            {
                PublicDelayLoadDLLs.Add("DBGHELP.DLL");
                PrivateDefinitions.Add("USE_BUNDLED_DBGHELP=1");
                RuntimeDependencies.Add("$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll");
            }
            else
            {
                PrivateDefinitions.Add("USE_BUNDLED_DBGHELP=0");
            }
            PrivateDefinitions.Add("YIELD_BETWEEN_TASKS=1");
        }
        else if ((Target.Platform == UnrealTargetPlatform.HoloLens))
        {
            PublicIncludePaths.Add("Runtime/Core/Public/HoloLens");
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "zlib");

            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "IntelTBB",
                                                         "XInput"
                                                         );
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "IntelTBB",
                                                         "zlib",
                                                         "PLCrashReporter",
                                                         "rd_route"
                                                         );
            PublicFrameworks.AddRange(new string[] { "Cocoa", "Carbon", "IOKit", "Security" });

            if (Target.bBuildEditor == true)
            {
                string SDKROOT = Utils.RunLocalProcessAndReturnStdOut("/usr/bin/xcrun", "--sdk macosx --show-sdk-path");
                PublicAdditionalLibraries.Add(SDKROOT + "/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport.tbd");
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "zlib"
                                                         );
            PublicFrameworks.AddRange(new string[] { "UIKit", "Foundation", "AudioToolbox", "AVFoundation", "GameKit", "StoreKit", "CoreVideo", "CoreMedia", "CoreGraphics", "GameController", "SystemConfiguration", "DeviceCheck", "UserNotifications" });
            if (Target.Platform == UnrealTargetPlatform.IOS)
            {
                PublicFrameworks.AddRange(new string[] { "CoreMotion", "AdSupport", "WebKit" });
                AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                             "PLCrashReporter"
                                                             );
            }

            PrivateIncludePathModuleNames.Add("ApplicationCore");

            bool bSupportAdvertising = Target.Platform == UnrealTargetPlatform.IOS;
            if (bSupportAdvertising)
            {
                PublicFrameworks.AddRange(new string[] { "iAD" });
            }

            // export Core symbols for embedded Dlls
            ModuleSymbolVisibility = ModuleRules.SymbolVisibility.VisibileForDll;
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Android))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "cxademangle",
                                                         "zlib",
                                                         "libunwind"
                                                         );
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "zlib",
                                                         "jemalloc"
                                                         );

            // Core uses dlopen()
            PublicSystemLibraries.Add("dl");
        }

        if (Target.bCompileICU == true)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "ICU");
        }
        PublicDefinitions.Add("UE_ENABLE_ICU=" + (Target.bCompileICU ? "1" : "0")); // Enable/disable (=1/=0) ICU usage in the codebase. NOTE: This flag is for use while integrating ICU and will be removed afterward.

        // If we're compiling with the engine, then add Core's engine dependencies
        if (Target.bCompileAgainstEngine == true)
        {
            if (!Target.bBuildRequiresCookedData)
            {
                DynamicallyLoadedModuleNames.AddRange(new string[] { "DerivedDataCache" });
            }
        }


        // On Windows platform, VSPerfExternalProfiler.cpp needs access to "VSPerf.h".  This header is included with Visual Studio, but it's not in a standard include path.
        if (Target.Platform.IsInGroup(UnrealPlatformGroup.Windows))
        {
            var VisualStudioVersionNumber = "11.0";
            var SubFolderName             = (Target.Platform == UnrealTargetPlatform.Win32) ? "PerfSDK" : "x64/PerfSDK";

            string PerfIncludeDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), String.Format("Microsoft Visual Studio {0}/Team Tools/Performance Tools/{1}", VisualStudioVersionNumber, SubFolderName));

            if (File.Exists(Path.Combine(PerfIncludeDirectory, "VSPerf.h")))
            {
                PrivateIncludePaths.Add(PerfIncludeDirectory);
                PublicDefinitions.Add("WITH_VS_PERF_PROFILER=1");
            }
            else
            {
                PublicDefinitions.Add("WITH_VS_PERF_PROFILER=0");
            }
        }

        if (Target.Platform == UnrealTargetPlatform.HoloLens)
        {
            PublicDefinitions.Add("WITH_VS_PERF_PROFILER=0");
        }

        if (Target.bWithDirectXMath && (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32))
        {
            PublicDefinitions.Add("WITH_DIRECTXMATH=1");
        }
        else
        {
            PublicDefinitions.Add("WITH_DIRECTXMATH=0");
        }

        // Set a macro to allow FApp::GetBuildTargetType() to detect client targts
        if (Target.Type == TargetRules.TargetType.Client)
        {
            PrivateDefinitions.Add("IS_CLIENT_TARGET=1");
        }
        else
        {
            PrivateDefinitions.Add("IS_CLIENT_TARGET=0");
        }

        // Decide if validating memory allocator (aka MallocStomp) can be used on the current platform.
        // Run-time validation must be enabled through '-stompmalloc' command line argument.

        bool bWithMallocStomp = false;

        if (Target.Configuration != UnrealTargetConfiguration.Shipping)
        {
            if (Target.Platform == UnrealTargetPlatform.Mac ||
                Target.Platform == UnrealTargetPlatform.Linux ||
                Target.Platform == UnrealTargetPlatform.LinuxAArch64 ||
                Target.Platform == UnrealTargetPlatform.Win64)
            // Target.Platform == UnrealTargetPlatform.Win32: // 32-bit windows can technically be supported, but will likely run out of virtual memory space quickly
            // Target.Platform == UnrealTargetPlatform.XboxOne: // XboxOne could be supported, as it's similar enough to Win64
            {
                bWithMallocStomp = true;
            }
        }

        PublicDefinitions.Add("WITH_MALLOC_STOMP=" + (bWithMallocStomp ? "1" : "0"));

        PrivateDefinitions.Add("PLATFORM_COMPILER_OPTIMIZATION_LTCG=" + (Target.bAllowLTCG ? "1" : "0"));
        PrivateDefinitions.Add("PLATFORM_COMPILER_OPTIMIZATION_PG=" + (Target.bPGOOptimize ? "1" : "0"));
        PrivateDefinitions.Add("PLATFORM_COMPILER_OPTIMIZATION_PG_PROFILING=" + (Target.bPGOProfile ? "1" : "0"));

        UnsafeTypeCastWarningLevel = WarningLevel.Warning;
    }
Example #11
0
    public WebSocket(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivatePCHHeaderFile = "Public/WebSocket.h";

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

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

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


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


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


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

            foreach (string Lib in StaticLibrariesAndroid)
            {
                PublicAdditionalLibraries.Add(Lib);
            }
        }
    }
Example #12
0
    public Engine(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivatePCHHeaderFile = "Private/EnginePrivatePCH.h";

        SharedPCHHeaderFile = "Public/EngineSharedPCH.h";

        PublicIncludePathModuleNames.AddRange(new string[] { "Renderer", "PacketHandler", "NetworkReplayStreaming", "AudioMixer", "AnimationCore" });

        PrivateIncludePaths.AddRange(
            new string[] {
            "Developer/DerivedDataCache/Public",
            "Runtime/SynthBenchmark/Public",
            "Runtime/Engine/Private",
        }
            );

        PrivateIncludePathModuleNames.AddRange(
            new string[] {
            "TargetPlatform",
            "ImageWrapper",
            "ImageWriteQueue",
            "HeadMountedDisplay",
            "EyeTracker",
            "MRMesh",
            "Advertising",
            "NetworkReplayStreaming",
            "MovieSceneCapture",
            "AutomationWorker",
            "MovieSceneCapture",
            "DesktopPlatform",
        }
            );

        if (Target.Configuration != UnrealTargetConfiguration.Shipping)
        {
            PrivateIncludePathModuleNames.AddRange(new string[] { "TaskGraph" });
        }

        if (Target.Configuration != UnrealTargetConfiguration.Shipping)
        {
            PrivateIncludePathModuleNames.AddRange(
                new string[] {
                "SlateReflector",
            }
                );

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

        PublicDependencyModuleNames.AddRange(
            new string[] {
            "Core",
            "CoreUObject",
            "ApplicationCore",
            "Json",
            "SlateCore",
            "Slate",
            "InputCore",
            "Messaging",
            "MessagingCommon",
            "RenderCore",
            "RHI",
            "ShaderCore",
            "Sockets",
            "UtilityShaders",
            "AssetRegistry",                     // Here until FAssetData is moved to engine
            "EngineMessages",
            "EngineSettings",
            "SynthBenchmark",
            "GameplayTags",
            "DatabaseSupport",
            "PacketHandler",
            "AudioPlatformConfiguration",
            "MeshDescription",
            "PakFile",
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[] {
            "AppFramework",
            "Networking",
            "Landscape",
            "UMG",
            "Projects",
            "MaterialShaderQualitySettings",
            "CinematicCamera",
            "Analytics",
            "AnalyticsET",
            //"CrunchCompression"
        }
            );

        DynamicallyLoadedModuleNames.Add("EyeTracker");


        if (Target.bUseXGEController &&
            Target.Type == TargetType.Editor &&
            (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32))
        {
            PrivateDependencyModuleNames.Add("XGEController");
        }

        if (Target.Configuration != UnrealTargetConfiguration.Shipping)
        {
            PrivateIncludePathModuleNames.Add("Localization");
            DynamicallyLoadedModuleNames.Add("Localization");
        }

        // to prevent "causes WARNING: Non-editor build cannot depend on non-redistributable modules."
        if (Target.Type == TargetType.Editor)
        {
            // for now we depend on this
            PrivateDependencyModuleNames.Add("RawMesh");
            PrivateDependencyModuleNames.Add("MeshDescriptionOperations");
        }

        bool bVariadicTemplatesSupported = true;

        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);
                if (VersionName.ToString().Equals("2012"))
                {
                    bVariadicTemplatesSupported = false;
                }
            }

            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "libOpus"
                                                         );
        }

        if (bVariadicTemplatesSupported)
        {
            PrivateIncludePathModuleNames.AddRange(
                new string[] {
                "MessagingRpc",
                "PortalRpc",
                "PortalServices",
            }
                );

            if (Target.Type == TargetType.Editor)
            {
                // these modules require variadic templates
                PrivateDependencyModuleNames.AddRange(
                    new string[] {
                    "MessagingRpc",
                    "PortalRpc",
                    "PortalServices",
                }
                    );
            }
        }

        CircularlyReferencedDependentModules.Add("GameplayTags");
        CircularlyReferencedDependentModules.Add("Landscape");
        CircularlyReferencedDependentModules.Add("UMG");
        CircularlyReferencedDependentModules.Add("MaterialShaderQualitySettings");
        CircularlyReferencedDependentModules.Add("CinematicCamera");

        // The AnimGraphRuntime module is not needed by Engine proper, but it is loaded in LaunchEngineLoop.cpp,
        // and needs to be listed in an always-included module in order to be compiled into standalone games
        DynamicallyLoadedModuleNames.Add("AnimGraphRuntime");

        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            "MovieScene",
            "MovieSceneCapture",
            "MovieSceneTracks",
            "HeadMountedDisplay",
            "MRMesh",
            "StreamingPauseRendering",
        }
            );

        if (Target.Type != TargetType.Server)
        {
            PrivateIncludePathModuleNames.AddRange(
                new string[] {
                "Media",
                "SlateNullRenderer",
                "SlateRHIRenderer"
            }
                );

            DynamicallyLoadedModuleNames.AddRange(
                new string[] {
                "Media",
                "SlateNullRenderer",
                "SlateRHIRenderer"
            }
                );
        }

        if (Target.Type == TargetType.Server || Target.Type == TargetType.Editor)
        {
            PrivateDependencyModuleNames.Add("PerfCounters");
        }

        if (Target.bBuildDeveloperTools)
        {
            // Add "BlankModule" so that it gets compiled as an example and will be maintained and tested.  This can be removed
            // at any time if needed.  The module isn't actually loaded by the engine so there is no runtime cost.
            DynamicallyLoadedModuleNames.Add("BlankModule");

            if (Target.Type != TargetType.Server)
            {
                PrivateIncludePathModuleNames.Add("MeshUtilities");
                PrivateIncludePathModuleNames.Add("MeshUtilitiesCommon");

                DynamicallyLoadedModuleNames.Add("MeshUtilities");

                PrivateDependencyModuleNames.AddRange(
                    new string[] {
                    "ImageCore",
                    "RawMesh"
                }
                    );
            }

            if (Target.Configuration != UnrealTargetConfiguration.Shipping && Target.Configuration != UnrealTargetConfiguration.Test && Target.Type != TargetType.Server)
            {
                PrivateDependencyModuleNames.Add("CollisionAnalyzer");
                CircularlyReferencedDependentModules.Add("CollisionAnalyzer");

                PrivateDependencyModuleNames.Add("LogVisualizer");
                CircularlyReferencedDependentModules.Add("LogVisualizer");
            }

            if (Target.Platform == UnrealTargetPlatform.Win64)
            {
                DynamicallyLoadedModuleNames.AddRange(
                    new string[] {
                    "WindowsTargetPlatform",
                    "WindowsNoEditorTargetPlatform",
                    "WindowsServerTargetPlatform",
                    "WindowsClientTargetPlatform",
                    "AllDesktopTargetPlatform",
                    "WindowsPlatformEditor",
                }
                    );
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                DynamicallyLoadedModuleNames.AddRange(
                    new string[] {
                    "MacTargetPlatform",
                    "MacNoEditorTargetPlatform",
                    "MacServerTargetPlatform",
                    "MacClientTargetPlatform",
                    "AllDesktopTargetPlatform",
                    "MacPlatformEditor",
                }
                    );
            }
            else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
            {
                DynamicallyLoadedModuleNames.AddRange(
                    new string[] {
                    "LinuxTargetPlatform",
                    "LinuxNoEditorTargetPlatform",
                    "LinuxServerTargetPlatform",
                    "LinuxClientTargetPlatform",
                    "AllDesktopTargetPlatform",
                    "LinuxPlatformEditor",
                }
                    );
            }
        }

        DynamicallyLoadedModuleNames.AddRange(
            new string[] {
            "NetworkReplayStreaming",
            "NullNetworkReplayStreaming",
            "HttpNetworkReplayStreaming",
            "Advertising"
        }
            );

        if (Target.Type != TargetType.Server)
        {
            DynamicallyLoadedModuleNames.AddRange(
                new string[] {
                "ImageWrapper"
            }
                );
        }

        WhitelistRestrictedFolders.Add("Private/NotForLicensees");

        if (!Target.bBuildRequiresCookedData && Target.bCompileAgainstEngine)
        {
            DynamicallyLoadedModuleNames.AddRange(
                new string[] {
                "DerivedDataCache",
                "TargetPlatform",
                "DesktopPlatform"
            }
                );
        }

        if (Target.bBuildEditor == true)
        {
            PublicDependencyModuleNames.AddRange(
                new string[] {
                "UnrealEd",
                "Kismet"
            }
                );              // @todo api: Only public because of WITH_EDITOR and UNREALED_API

            CircularlyReferencedDependentModules.AddRange(
                new string[] {
                "UnrealEd",
                "Kismet"
            }
                );

            PrivateIncludePathModuleNames.Add("TextureCompressor");
            PrivateIncludePaths.Add("Developer/TextureCompressor/Public");

            PrivateIncludePathModuleNames.Add("HierarchicalLODUtilities");
            DynamicallyLoadedModuleNames.Add("HierarchicalLODUtilities");

            DynamicallyLoadedModuleNames.Add("AnimationModifiers");

            PrivateIncludePathModuleNames.Add("AssetTools");
            DynamicallyLoadedModuleNames.Add("AssetTools");

            PrivateIncludePathModuleNames.Add("PIEPreviewDeviceProfileSelector");
        }

        SetupModulePhysicsSupport(Target);

        if (Target.bCompilePhysX && (Target.bBuildEditor || Target.bCompileAPEX))
        {
            DynamicallyLoadedModuleNames.Add("PhysXCooking");
        }

        // Engine public headers need to know about some types (enums etc.)
        PublicIncludePathModuleNames.Add("ClothingSystemRuntimeInterface");
        PublicDependencyModuleNames.Add("ClothingSystemRuntimeInterface");

        if (Target.bBuildEditor)
        {
            PrivateDependencyModuleNames.Add("ClothingSystemEditorInterface");
            PrivateIncludePathModuleNames.Add("ClothingSystemEditorInterface");
        }

        if ((Target.Platform == UnrealTargetPlatform.Win64) ||
            (Target.Platform == UnrealTargetPlatform.Win32))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "UEOgg",
                                                         "Vorbis",
                                                         "VorbisFile",
                                                         "libOpus"
                                                         );

            // Head Mounted Display support
//			PrivateIncludePathModuleNames.AddRange(new string[] { "HeadMountedDisplay" });
//			DynamicallyLoadedModuleNames.AddRange(new string[] { "HeadMountedDisplay" });
        }

        if (Target.Platform == UnrealTargetPlatform.HTML5)
        {
            // TODO test this for HTML5 !
            //AddEngineThirdPartyPrivateStaticDependencies(Target,
            //		"UEOgg",
            //		"Vorbis",
            //		"VorbisFile"
            //		);
            PublicDependencyModuleNames.Add("HTML5JS");
        }

        if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "UEOgg",
                                                         "Vorbis",
                                                         "libOpus"
                                                         );
            PublicFrameworks.AddRange(new string[] { "AVFoundation", "CoreVideo", "CoreMedia" });
        }

        if (Target.IsInPlatformGroup(UnrealPlatformGroup.Android))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "UEOgg",
                                                         "Vorbis",
                                                         "VorbisFile"
                                                         );

            PrivateDependencyModuleNames.Add("AndroidRuntimeSettings");
        }

        if (Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS)
        {
            PrivateDependencyModuleNames.Add("IOSRuntimeSettings");
        }

        if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            PrivateDependencyModuleNames.Add("SwitchRuntimeSettings");
        }

        if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                         "UEOgg",
                                                         "Vorbis",
                                                         "VorbisFile",
                                                         "libOpus"
                                                         );
        }

        PublicDefinitions.Add("GPUPARTICLE_LOCAL_VF_ONLY=0");

        // Add a reference to the stats HTML files referenced by UEngine::DumpFPSChartToHTML. Previously staged by CopyBuildToStagingDirectory.
        if (Target.bBuildEditor || Target.Configuration != UnrealTargetConfiguration.Shipping)
        {
            RuntimeDependencies.Add("$(EngineDir)/Content/Stats/...", StagedFileType.UFS);
        }
    }
    public Python(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

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

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

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

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

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

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

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

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

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

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

            default:
                break;
            }

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

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

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

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

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

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

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

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

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

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

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

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

        string EngineBinThirdPartyPath = Path.Combine("$(EngineDir)", "Binaries", "ThirdParty", "PhysX3");

        // Libraries and DLLs for windows platform
        if (Target.Platform.IsInGroup(UnrealPlatformGroup.Windows) && Target.Platform != UnrealTargetPlatform.Win32)
        {
            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(Path.Combine(PhysXLibDir, "Win64", "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName(), String.Format(Lib, LibrarySuffix)));
            }

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

            string PhysXBinariesDir = Path.Combine(EngineBinThirdPartyPath, "Win64", "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string DLL in DelayLoadDLLsX64)
            {
                string FileName = Path.Combine(PhysXBinariesDir, String.Format(DLL, LibrarySuffix));
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }

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

            foreach (string DLL in PxSharedRuntimeDependenciesX64)
            {
                RuntimeDependencies.Add(Path.Combine(PhysXBinariesDir, String.Format(DLL, LibrarySuffix)));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            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(Path.Combine(PhysXLibDir, "Win32", "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName(), String.Format(Lib, LibrarySuffix)));
            }

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

            string PhysXBinariesDir = Path.Combine(EngineBinThirdPartyPath, "Win32", "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string DLL in DelayLoadDLLsX86)
            {
                string FileName = Path.Combine(PhysXBinariesDir, String.Format(DLL, LibrarySuffix));
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }

            if (LibrarySuffix != "")
            {
                PublicDefinitions.Add("UE_PHYSX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.HoloLens)
        {
            string Arch = Target.WindowsPlatform.GetArchitectureSubpath();

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

            string[] DelayLoadDLLs = new string[] {
                "PxFoundation{0}_{1}.dll",
                "PxPvdSDK{0}_{1}.dll",
                "PhysX3{0}_{1}.dll",
                "PhysX3Cooking{0}_{1}.dll",
                "PhysX3Common{0}_{1}.dll",
            };

            string[] PxSharedRuntimeDependencies = new string[] {
                "PxFoundation{0}_{1}.dll",
                "PxPvdSDK{0}_{1}.dll",
            };

            foreach (string Lib in StaticLibraries)
            {
                PublicAdditionalLibraries.Add(Path.Combine(PhysXLibDir, Target.Platform.ToString(), "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName(), String.Format(Lib, LibrarySuffix, Arch)));
            }

            foreach (string DLL in DelayLoadDLLs)
            {
                PublicDelayLoadDLLs.Add(String.Format(DLL, LibrarySuffix, Arch));
            }
            string PhysXBinariesDir = Path.Combine(EngineBinThirdPartyPath, Target.Platform.ToString(), "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string DLL in DelayLoadDLLs)
            {
                string FileName = Path.Combine(PhysXBinariesDir, String.Format(DLL, LibrarySuffix, Arch));
                RuntimeDependencies.Add(FileName, StagedFileType.NonUFS);
                RuntimeDependencies.Add(Path.ChangeExtension(FileName, ".pdb"), StagedFileType.DebugNonUFS);
            }

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

            foreach (string DLL in PxSharedRuntimeDependencies)
            {
                RuntimeDependencies.Add(Path.Combine(PhysXBinariesDir, String.Format(DLL, LibrarySuffix, Arch)));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string[] StaticLibrariesMac = new string[] {
                Path.Combine(PhysXLibDir, "Mac", "libLowLevel{0}.a"),
                Path.Combine(PhysXLibDir, "Mac", "libLowLevelCloth{0}.a"),
                Path.Combine(PhysXLibDir, "Mac", "libPhysX3Extensions{0}.a"),
                Path.Combine(PhysXLibDir, "Mac", "libSceneQuery{0}.a"),
                Path.Combine(PhysXLibDir, "Mac", "libSimulationController{0}.a"),
                Path.Combine(PxSharedLibDir, "Mac", "libPxTask{0}.a"),
                Path.Combine(PxSharedLibDir, "Mac", "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 = Path.Combine(Target.UEThirdPartyBinariesDirectory, "PhysX3", "Mac");
            foreach (string Lib in DynamicLibrariesMac)
            {
                string LibraryPath = Path.Combine(PhysXBinariesDir, String.Format(Lib, LibrarySuffix));
                PublicDelayLoadDLLs.Add(LibraryPath);
                RuntimeDependencies.Add(LibraryPath);
            }

            if (LibrarySuffix != "")
            {
                PublicDefinitions.Add("UE_PHYSX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Android))
        {
            string[] Architectures = new string[] {
                "ARMv7",
                "ARM64",
                "x86",
                "x64",
            };

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

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

            foreach (string Architecture in Architectures)
            {
                foreach (string Lib in StaticLibrariesAndroid)
                {
                    PublicAdditionalLibraries.Add(Path.Combine(PhysXLibDir, "Android", Architecture, "lib" + String.Format(Lib, LibrarySuffix) + ".a"));
                }
            }
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            PublicSystemLibraries.Add("rt");

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

            foreach (string Lib in StaticLibrariesPhysXLinux)
            {
                PublicAdditionalLibraries.Add(Path.Combine(PhysXLibDir, "Linux", Target.Architecture, "lib" + String.Format(Lib, LibrarySuffix) + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.IOS)
        {
            string[] PhysXLibs = new string[]
            {
                "LowLevel{0}",
                "LowLevelAABB{0}",
                "LowLevelCloth{0}",
                "LowLevelDynamics{0}",
                "LowLevelParticles{0}",
                "PhysX3{0}",
                "PhysX3Common{0}",
                // "PhysX3Cooking{0}", // not needed until Apex
                "PhysX3Extensions{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
                "PxFoundation{0}",
                "PxTask{0}",
                "PxPvdSDK{0}",
                "PsFastXml{0}"
            };

            foreach (string PhysXLib in PhysXLibs)
            {
                PublicAdditionalLibraries.Add(Path.Combine(PhysXLibDir, "IOS", "lib" + String.Format(PhysXLib, LibrarySuffix) + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.TVOS)
        {
            string[] PhysXLibs = new string[]
            {
                "LowLevel{0}",
                "LowLevelAABB{0}",
                "LowLevelCloth{0}",
                "LowLevelDynamics{0}",
                "LowLevelParticles{0}",
                "PhysX3{0}",
                "PhysX3Common{0}",
                // "PhysX3Cooking{0}", // not needed until Apex
                "PhysX3Extensions{0}",
                "SceneQuery{0}",
                "SimulationController{0}",
                "PxFoundation{0}",
                "PxTask{0}",
                "PxPvdSDK{0}",
                "PsFastXml"
            };

            foreach (string PhysXLib in PhysXLibs)
            {
                PublicAdditionalLibraries.Add(Path.Combine(PhysXLibDir, "TVOS", "lib" + String.Format(PhysXLib, LibrarySuffix) + ".a"));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            PublicDefinitions.Add("PX_PHYSX_STATIC_LIB=1");
            PublicDefinitions.Add("_XBOX_ONE=1");

            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(Path.Combine(PhysXLibDir, "XboxOne", "VS2015", String.Format(Lib, LibrarySuffix)));
            }
        }
    }
Example #15
0
    public HarfBuzz(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

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

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

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

        string PlatformFolderName = Target.Platform.ToString();

        string HarfBuzzLibPath = HarfBuzzRootPath + PlatformFolderName + "/";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            PublicAdditionalLibraries.Add("harfbuzz");
        }

        else
        {
            PublicDefinitions.Add("WITH_HARFBUZZ=0");
        }
    }
    public MeshUtilities(ReadOnlyTargetRules Target) : base(Target)
    {
        PublicDependencyModuleNames.AddRange(
            new string[] {
            "MaterialUtilities",
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[] {
            "Core",
            "CoreUObject",
            "Engine",
            "RawMesh",
            "RenderCore",                     // For FPackedNormal
            "SlateCore",
            "Slate",
            "MaterialUtilities",
            "MeshBoneReduction",
            "UnrealEd",
            "RHI",
            "HierarchicalLODUtilities",
            "Landscape",
            "LevelEditor",
            "PropertyEditor",
            "EditorStyle",
            "GraphColor",
            "MeshBuilderCommon",
            "MeshUtilitiesCommon",
            "MeshDescription",
            "StaticMeshDescription",
            "ToolMenus",
        }
            );

        PublicIncludePathModuleNames.AddRange(
            new string[] {
            "MeshMergeUtilities"
        }
            );

        PrivateIncludePathModuleNames.AddRange(
            new string[] {
            "AnimationBlueprintEditor",
            "AnimationEditor",
            "MeshMergeUtilities",
            "MaterialBaking",
            "Persona",
            "SkeletalMeshEditor",
        }
            );

        DynamicallyLoadedModuleNames.AddRange(
            new string[] {
            "AnimationBlueprintEditor",
            "AnimationEditor",
            "MeshMergeUtilities",
            "MaterialBaking",
            "SkeletalMeshEditor",
        }
            );

        AddEngineThirdPartyPrivateStaticDependencies(Target, "nvTriStrip");
        AddEngineThirdPartyPrivateStaticDependencies(Target, "ForsythTriOptimizer");
        AddEngineThirdPartyPrivateStaticDependencies(Target, "QuadricMeshReduction");
        AddEngineThirdPartyPrivateStaticDependencies(Target, "MikkTSpace");
        AddEngineThirdPartyPrivateStaticDependencies(Target, "nvTessLib");

        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "DX9");
        }

        // Always use the official version of IntelTBB
        string IntelTBBLibs = Target.UEThirdPartySourceDirectory + "Intel/TBB/IntelTBB-2019u8/lib/";

        // EMBREE
        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            string SDKDir = Target.UEThirdPartySourceDirectory + "Intel/Embree/Embree2140/Win64/";

            PublicIncludePaths.Add(SDKDir + "include");
            PublicAdditionalLibraries.Add(SDKDir + "lib/embree.2.14.0.lib");
            RuntimeDependencies.Add("$(TargetOutputDir)/embree.2.14.0.dll", SDKDir + "lib/embree.2.14.0.dll");
            RuntimeDependencies.Add("$(TargetOutputDir)/tbb.dll", IntelTBBLibs + "Win64/vc14/tbb.dll");
            RuntimeDependencies.Add("$(TargetOutputDir)/tbbmalloc.dll", IntelTBBLibs + "Win64/vc14/tbbmalloc.dll");
            PublicDefinitions.Add("USE_EMBREE=1");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string SDKDir = Target.UEThirdPartySourceDirectory + "Intel/Embree/Embree2140/MacOSX/";

            PublicIncludePaths.Add(SDKDir + "include");
            PublicAdditionalLibraries.Add(SDKDir + "lib/libembree.2.14.0.dylib");
            PublicAdditionalLibraries.Add(IntelTBBLibs + "Mac/libtbb.dylib");
            PublicAdditionalLibraries.Add(IntelTBBLibs + "Mac/libtbbmalloc.dylib");
            RuntimeDependencies.Add("$(TargetOutputDir)/libembree.2.14.0.dylib", SDKDir + "lib/libembree.2.14.0.dylib");
            RuntimeDependencies.Add("$(TargetOutputDir)/libtbb.dylib", IntelTBBLibs + "Mac/libtbb.dylib");
            RuntimeDependencies.Add("$(TargetOutputDir)/libtbbmalloc.dylib", IntelTBBLibs + "Mac/libtbbmalloc.dylib");
            PublicDefinitions.Add("USE_EMBREE=1");
        }
        else
        {
            PublicDefinitions.Add("USE_EMBREE=0");
        }
    }
    public Steamworks(ReadOnlyTargetRules Target) : base(Target)
    {
        /** Mark the current version of the Steam SDK */
        string SteamVersion = "v139";

        Type = ModuleType.External;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            default:
                break;
            }

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

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

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

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

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

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

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

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

            PublicSystemIncludePaths.Add(PythonIncludePath);
            if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                // Mac doesn't understand PublicLibraryPaths
                PublicAdditionalLibraries.Add(Path.Combine(PythonLibPath, PythonLibName));
            }
            else
            {
                PublicLibraryPaths.Add(PythonLibPath);
                PublicAdditionalLibraries.Add(PythonLibName);
            }
        }
    }
Example #19
0
        public HiveMPSDK(ReadOnlyTargetRules Target) : base(Target)
        {
            PublicDefinitions.Add("HIVEMPSDK_PACKAGE=1");
            PublicDefinitions.Add("CLIENT_CONNECT_TARGETING_UNREAL=1");
            PublicDefinitions.Add("HAVE_LIBINTL_H=0");
            PublicDefinitions.Add("HAVE_STRING_H=0");
            PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

            PublicDependencyModuleNames.AddRange(
                new string[] {
                "Core",
                "CoreUObject",
                "Engine",
                "Sockets",
                "OnlineSubsystem",
                "OnlineSubsystemUtils",
                "Json",
                "Http",
                "PacketHandler",
                "WebSocket"
            }
                );

            string SdkBase = Path.GetFullPath(Path.Combine(ModuleDirectory, "Private/steam"));

            PrivateIncludePaths.Add(Path.Combine(SdkBase, "public"));

            string LibraryPath = SdkBase;
            string LibraryName = "steam_api";

            if (Target.Platform == UnrealTargetPlatform.Win32)
            {
                PublicDefinitions.Add("STEAMSDK_FOUND=1");
                PublicDefinitions.Add("WITH_STEAMWORKS=1");
                PublicLibraryPaths.Add(Path.Combine(LibraryPath, "win32"));
                PublicAdditionalLibraries.Add(LibraryName + ".lib");
                PublicDelayLoadDLLs.Add(LibraryName + ".dll");
                RuntimeDependencies.Add(Path.Combine(LibraryPath, "win32/" + LibraryName + ".dll"));
            }
            else if (Target.Platform == UnrealTargetPlatform.Win64)
            {
                PublicDefinitions.Add("STEAMSDK_FOUND=1");
                PublicDefinitions.Add("WITH_STEAMWORKS=1");
                PublicLibraryPaths.Add(Path.Combine(LibraryPath, "win64"));
                PublicAdditionalLibraries.Add(LibraryName + "64.lib");
                PublicDelayLoadDLLs.Add(LibraryName + "64.dll");
                RuntimeDependencies.Add(Path.Combine(LibraryPath, "win64/" + LibraryName + "64.dll"));
            }
            else if (Target.Platform == UnrealTargetPlatform.Mac)
            {
                PublicDefinitions.Add("STEAMSDK_FOUND=1");
                PublicDefinitions.Add("WITH_STEAMWORKS=1");
                PublicDelayLoadDLLs.Add(Path.Combine(LibraryPath, "osx/lib" + LibraryName + ".dylib"));
                PublicAdditionalShadowFiles.Add(LibraryPath);
                AdditionalBundleResources.Add(new UEBuildBundleResource(LibraryPath, "MacOS"));
            }
            else if (Target.Platform == UnrealTargetPlatform.Linux)
            {
                PublicDefinitions.Add("STEAMSDK_FOUND=1");
                PublicDefinitions.Add("WITH_STEAMWORKS=1");

                if (Target.LinkType == TargetLinkType.Monolithic)
                {
                    PublicLibraryPaths.Add(Path.Combine(LibraryPath, "linux64"));
                    PublicAdditionalLibraries.Add(LibraryName);
                }
                else
                {
                    PublicDelayLoadDLLs.Add(Path.Combine(LibraryPath, "linux64/lib" + LibraryName + ".so"));
                }
                PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "linux64/lib" + LibraryName + ".so"));
                RuntimeDependencies.Add(Path.Combine(LibraryPath, "linux64/lib" + LibraryName + ".so"));
            }
        }
    public ShooterGame(ReadOnlyTargetRules Target) : base(Target)
    {
        PrivatePCHHeaderFile = "Public/ShooterGame.h";

        PrivateIncludePaths.AddRange(
            new string[] {
            "ShooterGame/Private",
            "ShooterGame/Private/UI",
            "ShooterGame/Private/UI/Menu",
            "ShooterGame/Private/UI/Style",
            "ShooterGame/Private/UI/Widgets",
        }
            );

        PublicDependencyModuleNames.AddRange(
            new string[] {
            "Core",
            "CoreUObject",
            "Engine",
            "OnlineSubsystem",
            "OnlineSubsystemUtils",
            "AssetRegistry",
            "NavigationSystem",
            "AIModule",
            "GameplayTasks",
            "Gauntlet",
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[] {
            "InputCore",
            "Slate",
            "SlateCore",
            "ShooterGameLoadingScreen",
            "Json",
            "ApplicationCore",
            "ReplicationGraph",
            "PakFile",
            "Http",
            "FunapiDedicatedServer"
        }
            );
        if (Target.Type != TargetRules.TargetType.Server && Target.Platform != UnrealTargetPlatform.Linux)
        {
            PrivateDependencyModuleNames.Add("Funapi");
        }
        else
        {
            PublicDefinitions.Add("WITH_FUNAPI=0");
        }

        DynamicallyLoadedModuleNames.AddRange(
            new string[] {
            "OnlineSubsystemNull",
            "NetworkReplayStreaming",
            "NullNetworkReplayStreaming",
            "HttpNetworkReplayStreaming",
            "LocalFileNetworkReplayStreaming"
        }
            );

        PrivateIncludePathModuleNames.AddRange(
            new string[] {
            "NetworkReplayStreaming"
        }
            );

        if (Target.bBuildDeveloperTools || (Target.Configuration != UnrealTargetConfiguration.Shipping && Target.Configuration != UnrealTargetConfiguration.Test))
        {
            PrivateDependencyModuleNames.Add("GameplayDebugger");
            PublicDefinitions.Add("WITH_GAMEPLAY_DEBUGGER=1");
        }
        else
        {
            PublicDefinitions.Add("WITH_GAMEPLAY_DEBUGGER=0");
        }
    }
    public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicIncludePaths.AddRange(
            new string[] {
            Path.Combine(ModuleDirectory, "../ThirdParty/include")
        }
            );


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

        string platform = Target.Platform == UnrealTargetPlatform.Win64
            ? "Windows-x64"
            : "Unknown";

        string libPath = Path.Combine(ModuleDirectory, "../ThirdParty/lib/" + platform);

        string releasePostfix = "";
        string debugPostfix   = "d";

        bool   preferDebug = (Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.DebugGame);
        string postfix     = preferDebug ? debugPostfix : releasePostfix;

        string[] libs = new string[]
        {
            "async++",
            "Cesium3DTiles",
            "CesiumAsync",
            "CesiumGeometry",
            "CesiumGeospatial",
            "CesiumGltfReader",
            "CesiumGltf",
            "CesiumUtility",
            "draco",
            "modp_b64",
            "spdlog",
            "sqlite3",
            "tinyxml2",
            "uriparser"
        };

        if (preferDebug)
        {
            // We prefer Debug, but might still use Release if that's all that's available.
            foreach (string lib in libs)
            {
                string debugPath = Path.Combine(libPath, lib + debugPostfix + ".lib");
                if (!File.Exists(debugPath))
                {
                    Console.WriteLine("Using release build of cesium-native because a debug build is not available.");
                    preferDebug = false;
                    postfix     = releasePostfix;
                    break;
                }
            }
        }

        PublicAdditionalLibraries.AddRange(libs.Select(lib => Path.Combine(libPath, lib + postfix + ".lib")));

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


        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "RHI",
            "CoreUObject",
            "Engine",
            "MeshDescription",
            "StaticMeshDescription",
            "HTTP",
            "MikkTSpace",
            "LevelSequence"
        }
            );

        PublicDefinitions.AddRange(
            new string[]
        {
            "SPDLOG_COMPILED_LIB",
            "LIBASYNC_STATIC"
        }
            );

        if (Target.bCompilePhysX && !Target.bUseChaos)
        {
            PrivateDependencyModuleNames.Add("PhysXCooking");
            PrivateDependencyModuleNames.Add("PhysicsCore");
        }
        else
        {
            PrivateDependencyModuleNames.Add("Chaos");
        }

        if (Target.bBuildEditor == true)
        {
            PublicDependencyModuleNames.AddRange(
                new string[] {
                "UnrealEd",
                "Slate",
                "SlateCore",
            }
                );
        }

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

        PCHUsage             = PCHUsageMode.UseExplicitOrSharedPCHs;
        PrivatePCHHeaderFile = "Private/PCH.h";
        CppStandard          = CppStandardVersion.Cpp17;
    }
    public OpenVDB(ReadOnlyTargetRules Target) : base(Target)
    {
        // We are just setting up paths for pre-compiled binaries.
        Type = ModuleType.External;

        // For boost:: and TBB:: code
        bEnableUndefinedIdentifierWarnings = false;
        bUseRTTI = true;


        PublicDefinitions.Add("OPENVDB_STATICLIB");
        PublicDefinitions.Add("OPENVDB_OPENEXR_STATICLIB");
        PublicDefinitions.Add("OPENVDB_2_ABI_COMPATIBLE");

        PublicIncludePaths.Add(ModuleDirectory);

        // For testing during developement
        bool bDebugPaths = true;

        // Only building for Windows

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            string OpenVDBHeaderDir = ModuleDirectory + "/openvdb";


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

            PublicIncludePaths.Add(OpenVDBHeaderDir);

            // Construct the OpenVDB directory name
            string LibDirName = ModuleDirectory + "/Deploy/";
            LibDirName += "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName() + "/lib/x64/";

            bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT);

            if (bDebug)
            {
                LibDirName += "Debug/";
            }
            else
            {
                LibDirName += "Release/";
            }

            if (bDebugPaths)
            {
                // Look for the file
                if (!File.Exists(LibDirName + "OpenVDB.lib"))
                {
                    string Err = string.Format("OpenVDB.lib not found in {0}", LibDirName);
                    System.Console.WriteLine(Err);
                    throw new BuildException(Err);
                }
            }
            PublicAdditionalLibraries.Add(LibDirName + "OpenVDB.lib");

            // Add openexr
            PublicIncludePaths.Add(Target.UEThirdPartySourceDirectory);// + "openexr/Deploy/include");



            // Add TBB
            {
                // store the compiled tbb library in the same area as the rest of the third party code
                string TBBPath = Target.UEThirdPartySourceDirectory + "Intel/TBB/IntelTBB-2019u8";
                PublicIncludePaths.Add(Path.Combine(TBBPath, "include"));
                string TBBLibPath = TBBPath + "/lib/Win64/vc14";
                if (bDebug)
                {
                    PublicAdditionalLibraries.Add(Path.Combine(TBBLibPath, "tbb_debug.lib"));
                }
                else
                {
                    PublicAdditionalLibraries.Add(Path.Combine(TBBLibPath, "tbb.lib"));
                }
            }
            // Add LibZ
            {
                string ZLibPath = Target.UEThirdPartySourceDirectory + "zlib/zlib-1.2.5/Lib/Win64";
                if (bDebug)
                {
                    PublicAdditionalLibraries.Add(Path.Combine(ZLibPath, "zlibd_64.lib"));
                }
                else
                {
                    PublicAdditionalLibraries.Add(Path.Combine(ZLibPath, "zlib_64.lib"));
                }
            }
        }
        else
        {
            string Err = "Wrong build env!";
            System.Console.WriteLine(Err);
            throw new BuildException(Err);
        }
    }
Example #23
0
        public NodeGraphAssistant(ReadOnlyTargetRules Target) : base(Target)
        {
            PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
            string enginePath = Path.GetFullPath(Target.RelativeEnginePath);

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

            PrivateIncludePaths.AddRange(
                new string[] {
                enginePath + "Source/Runtime/Core/Public",
                enginePath + "Source/Runtime/Projects/Public",
                enginePath + "Source/Runtime/Projects/Public/Interfaces",
                enginePath + "Source/Runtime/Engine/Classes",
                enginePath + "Source/Runtime/Engine/Public",
                enginePath + "Source/Runtime/SlateCore/Public/Styling",
                enginePath + "Source/Runtime/Slate/Public/Framework/Application",
                enginePath + "Source/Runtime/Slate/Public/Framework",
                enginePath + "Source/Runtime/SlateCore/Public",
                enginePath + "Source/Editor/UnrealEd/Public",
                enginePath + "Source/Editor/UnrealEd/Classes",
                enginePath + "Source/Editor/GraphEditor/Public",
                enginePath + "Source/Editor/EditorStyle/Public",
                enginePath + "Source/Editor/MaterialEditor/Public",
                enginePath + "Source/Editor/AnimationBlueprintEditor/Public",
                enginePath + "Source/Editor/Kismet/Public",
                enginePath + "Source/Editor/BlueprintGraph/Classes",
                enginePath + "Source/Editor/KismetWidgets/Public",

                //enginePath+"Source/Editor/PropertyEditor/Public",
            }
                );
            PrivateIncludePaths.Add(enginePath + "Source/Editor/GraphEditor/Private");
            PrivateIncludePaths.Add(enginePath + "Source/Runtime/Launch/Resources");
            PrivateIncludePaths.Add(enginePath + "Source/Runtime/Engine/Classes/EdGraph");
            PrivateIncludePaths.Add(enginePath + "Source/Editor/AnimationBlueprintEditor/Private");
            PrivateIncludePaths.Add(enginePath + "Source/Editor/AudioEditor/Private");
            PrivateIncludePaths.Add(enginePath + "Source/Editor/UnrealEd/Private");

            //PrivateIncludePaths.Add(enginePath + "Plugins/FX/Niagara/Source/NiagaraEditor/Public");

            PrivateDependencyModuleNames.AddRange(
                new string[]
            {
                "Core", "CoreUObject", "Slate", "SlateCore", "UnrealEd", "GraphEditor",
                "InputCore", "EditorStyle", "Engine", "AnimGraph", "Projects",
                "MaterialEditor", "BlueprintGraph", "AnimationBlueprintEditor", "AudioEditor", "KismetWidgets",
                //"PropertyEditor","AppFramework","NiagaraEditor",
                // ... add private dependencies that you statically link with here ...
            }
                );

            //some classes is not exported from engine, so when build with release engine it can not find the implementation.
            if (File.Exists(enginePath + "Source/Editor/GraphEditor/Private/DragConnection.cpp"))
            {
                PublicDefinitions.Add("NGA_WITH_ENGINE_CPP");
            }
            else
            {
                Log.TraceInformation("one or more engine cpp file not found, is it release build of ue4?");
                Log.TraceInformation("source file added from plugin dir");
            }

            DynamicallyLoadedModuleNames.AddRange(
                new string[]
            {
                // ... add any modules that your module loads dynamically here ...
            }
                );
        }
Example #24
0
    public ResonanceAudio(ReadOnlyTargetRules Target) : base(Target)
    {
        string ResonanceAudioPath        = ModuleDirectory + "/Private/ResonanceAudioLibrary";
        string ResonanceAudioLibraryPath = ModuleDirectory + "/Private/ResonanceAudioLibrary/resonance_audio";
        string PFFTPath = ModuleDirectory + "/Private/ResonanceAudioLibrary/third_party/pfft";

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

        PrivateIncludePaths.AddRange(
            new string[] {
            "ResonanceAudio/Private",
            ResonanceAudioPath,
            ResonanceAudioLibraryPath,
            PFFTPath,
            "../../../../Source/Runtime/AudioMixer/Private"
        }
            );

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

        PrivateIncludePathModuleNames.AddRange(
            new string[] {
            "TargetPlatform"
        }
            );

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

        if (Target.bBuildEditor == true)
        {
            PrivateDependencyModuleNames.Add("UnrealEd");
            PrivateDependencyModuleNames.Add("Landscape");
        }

        ShadowVariableWarningLevel = WarningLevel.Off;

        AddEngineThirdPartyPrivateStaticDependencies(Target,
                                                     "UEOgg",
                                                     "Vorbis",
                                                     "VorbisFile",
                                                     "Eigen"
                                                     );

        if (bSupportsProceduralMesh)
        {
            PrivateDependencyModuleNames.Add("ProceduralMeshComponent");
            PrivateDefinitions.Add("SUPPORTS_PROCEDURAL_MESH=1");
        }
        else
        {
            PrivateDefinitions.Add("SUPPORTS_PROCEDURAL_MESH=0");
        }

        if (Target.Platform == UnrealTargetPlatform.Android)
        {
            PrivateDefinitions.Add("PFFFT_SIMD_DISABLE=1");
            PrivateDefinitions.Add("EIGEN_HAS_CXX11_MATH=0");
        }

        //Embree support:
        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            string SDKDir = Target.UEThirdPartySourceDirectory + "IntelEmbree/Embree2140/Win64/";

            PublicIncludePaths.Add(SDKDir + "include");
            PublicAdditionalLibraries.Add(SDKDir + "lib/embree.2.14.0.lib");
            RuntimeDependencies.Add("$(TargetOutputDir)/embree.2.14.0.dll", SDKDir + "lib/embree.2.14.0.dll");
            RuntimeDependencies.Add("$(TargetOutputDir)/tbb.dll", SDKDir + "lib/tbb.dll");
            RuntimeDependencies.Add("$(TargetOutputDir)/tbbmalloc.dll", SDKDir + "lib/tbbmalloc.dll");
            PublicDefinitions.Add("USE_EMBREE=1");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string SDKDir = Target.UEThirdPartySourceDirectory + "IntelEmbree/Embree2140/MacOSX/";

            PublicIncludePaths.Add(SDKDir + "include");

            PrivateDefinitions.Add("USE_EMBREE=1");
        }
        else
        {
            // In platforms that don't support Embree, we implement no-op versions of the functions.
            string SDKDir = Target.UEThirdPartySourceDirectory + "IntelEmbree/Embree2140/";
            PublicIncludePaths.Add(SDKDir + "include");
            PublicDefinitions.Add("USE_EMBREE=0");
            PrivateDefinitions.Add("EMBREE_STATIC_LIB=1");
        }
    }
Example #25
0
    public XMPP(ReadOnlyTargetRules Target) : base(Target)
    {
        PublicDefinitions.Add("XMPP_PACKAGE=1");

        PrivateIncludePaths.AddRange(
            new string[]
        {
            "Runtime/Online/XMPP/Private"
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "Json"
        }
            );

        bool TargetPlatformSupportsJingle  = bTargetPlatformSupportsJingle;
        bool TargetPlatformSupportsStrophe = bTargetPlatformSupportsStrophe;

        if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            TargetPlatformSupportsJingle  = true;
            TargetPlatformSupportsStrophe = true;
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32 ||
                 Target.Platform == UnrealTargetPlatform.Win64 ||
                 Target.Platform == UnrealTargetPlatform.XboxOne ||
                 Target.Platform == UnrealTargetPlatform.Android ||
                 Target.Platform == UnrealTargetPlatform.IOS ||
                 Target.Platform == UnrealTargetPlatform.Switch ||
                 Target.Platform == UnrealTargetPlatform.Mac ||
                 Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            TargetPlatformSupportsStrophe = true;
        }

        if (TargetPlatformSupportsJingle)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "WebRTC");
            PrivateDefinitions.Add("WITH_XMPP_JINGLE=1");
        }
        else
        {
            PrivateDefinitions.Add("WITH_XMPP_JINGLE=0");
        }

        if (TargetPlatformSupportsStrophe)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "libstrophe");
            PrivateDependencyModuleNames.Add("WebSockets");
            PrivateDefinitions.Add("WITH_XMPP_STROPHE=1");
        }
        else
        {
            PrivateDefinitions.Add("WITH_XMPP_STROPHE=0");
        }

        if (Target.Platform == UnrealTargetPlatform.Win64 ||
            Target.Platform == UnrealTargetPlatform.Win32 ||
            Target.Platform == UnrealTargetPlatform.Mac ||
            Target.Platform == UnrealTargetPlatform.PS4 ||
            bRequireOpenSSL)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "OpenSSL");
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "libcurl");
        }
    }
    public AdvancePak(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

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


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


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


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


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

        bool bWithCurl = false;

        if (Target.Platform == UnrealTargetPlatform.Win32 ||
            Target.Platform == UnrealTargetPlatform.Win64)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "WinHttp");
            AddEngineThirdPartyPrivateStaticDependencies(Target, "libcurl");
            AddEngineThirdPartyPrivateStaticDependencies(Target, "OpenSSL");

            bWithCurl = true;
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix) ||
                 Target.IsInPlatformGroup(UnrealPlatformGroup.Android))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "libcurl");
            AddEngineThirdPartyPrivateStaticDependencies(Target, "OpenSSL");

            bWithCurl = true;
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "libcurl");

            bWithCurl = true;
        }
        else
        {
            PublicDefinitions.Add("WITH_LIBCURL=0");
        }

        if (bWithCurl)
        {
            PublicDefinitions.Add("CURL_ENABLE_DEBUG_CALLBACK=1");
            if (Target.Configuration != UnrealTargetConfiguration.Shipping)
            {
                PublicDefinitions.Add("CURL_ENABLE_NO_TIMEOUTS_OPTION=1");
            }
        }

        if (Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS || Target.Platform == UnrealTargetPlatform.Mac)
        {
            PublicFrameworks.Add("Security");
        }
    }
Example #27
0
    public HoudiniEngine(ReadOnlyTargetRules Target) : base(Target)
    {
        bPrecompile          = true;
        PCHUsage             = PCHUsageMode.NoSharedPCHs;
        PrivatePCHHeaderFile = "Private/HoudiniEnginePrivatePCH.h";

        // Check if we are compiling on unsupported platforms.
        if (Target.Platform != UnrealTargetPlatform.Win64 &&
            Target.Platform != UnrealTargetPlatform.Mac &&
            Target.Platform != UnrealTargetPlatform.Linux)
        {
            string Err = string.Format("Houdini Engine : Compiling for unsupported platform.");
            Log.TraceError(Err);
            throw new BuildException(Err);
        }

        if (Target.bBuildEditor == false)
        {
            // Actual Runtime Houdini Engine, currently not supported
            string Err = string.Format("Houdini Engine : Building as a runtime module is currently not supported.");
            Log.TraceError(Err);
            throw new BuildException(Err);
        }

        // Find HFS
        string HFSPath = GetHFSPath();

        HFSPath = HFSPath.Replace("\\", "/");

        if (HFSPath != "")
        {
            string log = string.Format("Houdini Engine : Found Houdini in {0}", HFSPath);
            Log.TraceInformationOnce(log);

            PlatformID buildPlatformId = Environment.OSVersion.Platform;
            if (buildPlatformId == PlatformID.Win32NT)
            {
                PublicDefinitions.Add("HOUDINI_ENGINE_HFS_PATH_DEFINE=" + HFSPath);
            }
        }

        PublicIncludePaths.AddRange(
            new string[]
        {
            //Path.Combine(ModuleDirectory, "Public/HAPI"),
            //"HoudiniEngineRuntime/Public/HAPI"
        }
            );

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

        // Add common dependencies.
        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "CoreUObject",
            "Engine",
            "HoudiniEngineRuntime",
            "RenderCore",
            "InputCore",
            "RHI",
            "Foliage",
            "Landscape",
            "StaticMeshDescription",
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "Landscape",
            "PhysicsCore"
        }
            );

        if (Target.bBuildEditor == true)
        {
            PrivateDependencyModuleNames.AddRange(
                new string[]
            {
                "AppFramework",
                "AssetTools",
                "EditorStyle",
                "EditorWidgets",
                "Kismet",
                "LevelEditor",
                "MainFrame",
                "MeshPaint",
                "Projects",
                "PropertyEditor",
                "RawMesh",
                "Settings",
                "Slate",
                "SlateCore",
                "TargetPlatform",
                "UnrealEd",
                "ApplicationCore",
                "LandscapeEditor",
                "MeshDescription",
                "MeshDescriptionOperations",
                "WorldBrowser",
                "Messaging",
                "SlateNullRenderer"
            }
                );
        }

        PrivateIncludePathModuleNames.AddRange(
            new string[]
        {
            "DirectoryWatcher"
        }
            );

        DynamicallyLoadedModuleNames.AddRange(
            new string[]
        {
            // ... add any modules that your module loads dynamically here ...
            "DirectoryWatcher"
        }
            );
    }
Example #28
0
    public UnrealLightmass(ReadOnlyTargetRules Target) : base(Target)
    {
        PublicIncludePaths.Add("Runtime/Launch/Public");

        PrivateDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "zlib", "SwarmInterface", "Projects", "ApplicationCore" });

        PublicDefinitions.Add("UE_LIGHTMASS=1");

        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
        {
            AddEngineThirdPartyPrivateStaticDependencies(Target, "DX9");

            // Unreallightmass requires GetProcessMemoryInfo exported by psapi.dll. http://msdn.microsoft.com/en-us/library/windows/desktop/ms683219(v=vs.85).aspx
            PublicSystemLibraries.Add("psapi.lib");
            PrivateDependencyModuleNames.AddRange(
                new string[] {
                "Messaging",
            }
                );
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux)
        {
            // On Mac/Linux UnrealLightmass is executed locally and communicates with the editor using Messaging module instead of SwarmAgent
            // @todo: allow for better plug-in support in standalone Slate apps
            PrivateDependencyModuleNames.AddRange(
                new string[] {
                "Networking",
                "Sockets",
                "Messaging",
                "UdpMessaging",
            }
                );

            PrivateIncludePathModuleNames.AddRange(
                new string[] {
                "Messaging",
            }
                );
        }

        // Lightmass ray tracing is 8% faster with buffer security checks disabled due to fixed size arrays on the stack in the kDOP ray tracing functions
        // Warning: This means buffer overwrites will not be detected
        bEnableBufferSecurityChecks = false;

        PrivateIncludePaths.Add("Runtime/Launch/Private");                      // For LaunchEngineLoop.cpp include
        PrivateIncludePaths.Add("Programs/UnrealLightmass/Private/Launch");
        PrivateIncludePaths.Add("Programs/UnrealLightmass/Private/ImportExport");
        PrivateIncludePaths.Add("Programs/UnrealLightmass/Private/CPUSolver");
        PrivateIncludePaths.Add("Programs/UnrealLightmass/Private/Lighting");
        PrivateIncludePaths.Add("Programs/UnrealLightmass/Private/LightmassCore");
        PrivateIncludePaths.Add("Programs/UnrealLightmass/Private/LightmassCore/Misc");
        PrivateIncludePaths.Add("Programs/UnrealLightmass/Private/LightmassCore/Math");
        PrivateIncludePaths.Add("Programs/UnrealLightmass/Private/LightmassCore/Templates");

        // Always use the official version of IntelTBB
        string IntelTBBLibs = Target.UEThirdPartySourceDirectory + "IntelTBB/IntelTBB-2019u8/lib/";

        // EMBREE
        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            string SDKDir = Target.UEThirdPartySourceDirectory + "IntelEmbree/Embree270/Win64/";

            PublicIncludePaths.Add(SDKDir + "include");
            PublicAdditionalLibraries.Add(SDKDir + "lib/embree.lib");
            RuntimeDependencies.Add("$(EngineDir)/Binaries/Win64/embree.dll");
            RuntimeDependencies.Add("$(EngineDir)/Binaries/Win64/tbb.dll", IntelTBBLibs + "Win64/vc14/tbb.dll");
            RuntimeDependencies.Add("$(EngineDir)/Binaries/Win64/tbbmalloc.dll", IntelTBBLibs + "Win64/vc14/tbbmalloc.dll");
            PublicDefinitions.Add("USE_EMBREE=1");
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string SDKDir = Target.UEThirdPartySourceDirectory + "IntelEmbree/Embree270/MacOSX/";

            PublicIncludePaths.Add(SDKDir + "include");
            PublicAdditionalLibraries.Add(SDKDir + "lib/libembree.2.dylib");
            RuntimeDependencies.Add("$(EngineDir)/Binaries/Mac/libembree.2.dylib");
            RuntimeDependencies.Add("$(EngineDir)/Binaries/Mac/libtbb.dylib", IntelTBBLibs + "Mac/libtbb.dylib");             // Take latest version to avoid overwriting the editor's copy
            RuntimeDependencies.Add("$(EngineDir)/Binaries/Mac/libtbbmalloc.dylib", IntelTBBLibs + "Mac/libtbbmalloc.dylib");
            PublicDefinitions.Add("USE_EMBREE=1");
        }
        else
        {
            PublicDefinitions.Add("USE_EMBREE=0");
        }
    }
Example #29
0
    public FBX(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        string FBXSDKDir = Target.UEThirdPartySourceDirectory + "FBX/2018.1.1/";

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


        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            string FBxLibPath = FBXSDKDir + "lib/vs" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName() + "/";

            FBxLibPath += "x64/release/";
            PublicLibraryPaths.Add(FBxLibPath);

            if (Target.LinkType != TargetLinkType.Monolithic)
            {
                PublicAdditionalLibraries.Add("libfbxsdk.lib");

                // We are using DLL versions of the FBX libraries
                PublicDefinitions.Add("FBXSDK_SHARED");

                RuntimeDependencies.Add("$(TargetOutputDir)/libfbxsdk.dll", FBxLibPath + "libfbxsdk.dll");
            }
            else
            {
                if (Target.bUseStaticCRT)
                {
                    PublicAdditionalLibraries.Add("libfbxsdk-mt.lib");
                }
                else
                {
                    PublicAdditionalLibraries.Add("libfbxsdk-md.lib");
                }
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            string FBxLibPath = FBXSDKDir + "lib/clang/release/";
            PublicAdditionalLibraries.Add(FBxLibPath + "libfbxsdk.dylib");
            RuntimeDependencies.Add("$(TargetOutputDir)/libfbxsdk.dylib", FBxLibPath + "libfbxsdk.dylib");
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            string LibDir = FBXSDKDir + "lib/gcc4/" + Target.Architecture + "/release/";
            if (!Target.bIsEngineInstalled && !Directory.Exists(LibDir))
            {
                string Err = string.Format("FBX SDK not found in {0}", LibDir);
                System.Console.WriteLine(Err);
                throw new BuildException(Err);
            }

            PublicAdditionalLibraries.Add(LibDir + "/libfbxsdk.a");

            /* There is a bug in fbxarch.h where is doesn't do the check
             * for clang under linux */
            PublicDefinitions.Add("FBXSDK_COMPILER_CLANG");

            // libfbxsdk has been built against libstdc++ and as such needs this library
            PublicAdditionalLibraries.Add("stdc++");
        }
    }
    public ActionRPGGame(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
        PublicDefinitions.Add("BOOST_SYSTEM_NOEXCEPT");
        PublicDefinitions.Add("GPR_FORBID_UNREACHABLE_CODE=1");
        PublicDefinitions.Add("GOOGLE_PROTOBUF_NO_RTTI=1");
        PrivateIncludePaths.AddRange(
            new string[] {
            // ... add other private include paths required here ...
        }
            );
        PublicDependencyModuleNames.AddRange(new string[] {
            "Core",
            "CoreUObject",
            "Engine",
            "InputCore",
            "Json",
            "JsonUtilities",
            "GameplayTags",
            "AbilityFramework",
            "AssetRegistry",
            "OrionAnimation",
            "ActorSequence",
            "JsonUObject",
            "InventoryFramework",
            "OnlineSubsystem"
        });

        if (Target.Type == TargetRules.TargetType.Editor)
        {
            PublicDependencyModuleNames.AddRange(new string[] { "UnrealEd", "SourceControl", "Matinee", "PropertyEditor", "ShaderCore", "AbilityFrameworkEditor" });
            PrivateDependencyModuleNames.AddRange(new string[] { "AbilityFrameworkEditor" });
        }
        PublicDependencyModuleNames.AddRange(new string[] { "GRPC" });
        PublicDefinitions.Add("GPR_GCOV=1"); //hax
        if (Target.Type == TargetRules.TargetType.Server)
        {
            if (Target.Platform == UnrealTargetPlatform.Linux)
            {
                PublicDefinitions.Add("WITH_AGONES=1");
                PublicDefinitions.Add("ENABLE_GRPC=1"); //hack
                PublicDependencyModuleNames.AddRange(new string[] { "Agones" });
            }
            else
            {
                PublicDefinitions.Add("WITH_AGONES=0");
                PublicDefinitions.Add("ENABLE_GRPC=0"); //hack
            }
        }
        else
        {
            PublicDefinitions.Add("WITH_AGONES=0");
            PublicDefinitions.Add("ENABLE_GRPC=0"); //hack
        }

        if ((Target.Type == TargetRules.TargetType.Client) || (Target.Type == TargetRules.TargetType.Editor))
        {
            PublicDependencyModuleNames.AddRange(new string[] {
                "Slate",
                "SlateCore",
                "UMG",
                "InventoryFrameworkUI",
                "DraggableWindow"
            });

            if (Target.Platform == UnrealTargetPlatform.Win64)
            {
                if (Target.Type == TargetRules.TargetType.Client)
                {
                    bEnableExceptions = true;
                }
            }
        }
    }