Beispiel #1
0
    static string GetAPEXLibrarySuffix(APEXLibraryMode Mode)
    {
        bool bShippingBuildsActuallyUseShippingAPEXLibraries = false;

        switch (Mode)
        {
        case APEXLibraryMode.Debug:
            return("DEBUG");

        case APEXLibraryMode.Checked:
            return("CHECKED");

        case APEXLibraryMode.Profile:
            return("PROFILE");

        default:
        case APEXLibraryMode.Shipping:
        {
            if (bShippingBuildsActuallyUseShippingAPEXLibraries)
            {
                return("");
            }
            else
            {
                return("PROFILE");
            }
        }
        }
    }
Beispiel #2
0
	static string GetAPEXLibrarySuffix(APEXLibraryMode Mode)
	{
		bool bShippingBuildsActuallyUseShippingAPEXLibraries = false;

		switch (Mode)
		{
			case APEXLibraryMode.Debug:
				return "DEBUG";
			case APEXLibraryMode.Checked:
				return "CHECKED";
			case APEXLibraryMode.Profile:
				return "PROFILE";
			default:
			case APEXLibraryMode.Shipping:
				{
					if( bShippingBuildsActuallyUseShippingAPEXLibraries )
					{
						return "";	
					}
					else
					{
						return "PROFILE";
					}
				}
		}
	}
Beispiel #3
0
	static string GetAPEXLibrarySuffix(APEXLibraryMode Mode)
	{

		switch (Mode)
		{
			case APEXLibraryMode.Debug:
				return "DEBUG";
			case APEXLibraryMode.Checked:
				return "CHECKED";
			case APEXLibraryMode.Profile:
				return "PROFILE";
			default:
			case APEXLibraryMode.Shipping:
				{
                    if (BuildConfiguration.bUseShippingPhysXLibraries)
					{
						return "";	
					}
					else
					{
						return "PROFILE";
					}
				}
		}
	}
 static string GetAPEXLibrarySuffix(APEXLibraryMode Mode)
 {
     switch (Mode)
     {
         case APEXLibraryMode.Debug:
             return "DEBUG";
         case APEXLibraryMode.Checked:
             return "CHECKED";
         case APEXLibraryMode.Profile:
             return "PROFILE";
         case APEXLibraryMode.Shipping:
         default:
             return "";
     }
 }
	static string GetAPEXLibrarySuffix(APEXLibraryMode Mode)
	{
		switch (Mode)
		{
			case APEXLibraryMode.Debug:
				return "DEBUG";
			case APEXLibraryMode.Checked:
				return "CHECKED";
			case APEXLibraryMode.Profile:
				return "PROFILE";
            case APEXLibraryMode.Shipping:
            default:
				return "";	
		}
	}
    static string GetAPEXLibrarySuffix(APEXLibraryMode Mode)
    {
        switch (Mode)
        {
        case APEXLibraryMode.Debug:
            return("DEBUG");

        case APEXLibraryMode.Checked:
            return("CHECKED");

        case APEXLibraryMode.Profile:
            return("PROFILE");

        default:
        case APEXLibraryMode.Shipping:
            return("");
        }
    }
Beispiel #7
0
    public APEX(TargetInfo Target)
    {
        Type = ModuleType.External;

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

        Definitions.Add("WITH_APEX=1");

        string APEXDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/APEX-1.3/";

        string APEXLibDir = APEXDir + "lib";

        PublicSystemIncludePaths.AddRange(
            new string[] {
            APEXDir + "public",
            APEXDir + "framework/public",
            APEXDir + "framework/public/PhysX3",
            APEXDir + "module/destructible/public",
            APEXDir + "module/clothing/public",
            APEXDir + "module/legacy/public",
            APEXDir + "NxParameterized/public",
        }
            );

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

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

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

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

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

            string ApexBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX/APEX-1.3/Win64/VS{0}/", WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string RuntimeDependency in RuntimeDependenciesX64)
            {
                RuntimeDependencies.Add(new RuntimeDependency(ApexBinariesDir + String.Format(RuntimeDependency, LibrarySuffix)));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Win32)
        {
            APEXLibDir += "/Win32/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(APEXLibDir);

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

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

            string ApexBinariesDir = String.Format("$(EngineDir)/Binaries/ThirdParty/PhysX/APEX-1.3/Win32/VS{0}/", WindowsPlatform.GetVisualStudioCompilerVersionName());
            foreach (string RuntimeDependency in RuntimeDependenciesX86)
            {
                RuntimeDependencies.Add(new RuntimeDependency(ApexBinariesDir + String.Format(RuntimeDependency, LibrarySuffix)));
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            APEXLibDir += "/osx64";
            Definitions.Add("APEX_STATICALLY_LINKED=1");

            ApexLibraries.Add("APEX_Legacy{0}");

            LibraryFormatString = APEXLibDir + "/lib{0}" + ".a";
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            APEXLibDir += "/Linux/" + Target.Architecture;
            Definitions.Add("APEX_STATICALLY_LINKED=1");

            ApexLibraries.Add("APEX_Legacy{0}");

            LibraryFormatString = APEXLibDir + "/lib{0}" + ".a";
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            Definitions.Add("APEX_STATICALLY_LINKED=1");
            Definitions.Add("WITH_APEX_LEGACY=0");

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

            LibraryFormatString = "{0}";
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            // Use reflection to allow type not to exist if console code is not present
            System.Type XboxOnePlatformType = System.Type.GetType("UnrealBuildTool.XboxOnePlatform,UnrealBuildTool");
            if (XboxOnePlatformType != null)
            {
                Definitions.Add("APEX_STATICALLY_LINKED=1");
                Definitions.Add("WITH_APEX_LEGACY=0");

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

                System.Object VersionName = XboxOnePlatformType.GetMethod("GetVisualStudioCompilerVersionName").Invoke(null, null);
                APEXLibDir += "/XboxOne/VS" + VersionName.ToString();
                PublicLibraryPaths.Add(APEXLibDir);

                LibraryFormatString = "{0}.lib";
            }
        }

        // Add the libraries needed (used for all platforms except Windows)
        if (LibraryFormatString != null)
        {
            foreach (string Lib in ApexLibraries)
            {
                string ConfiguredLib = String.Format(Lib, LibrarySuffix);
                string FinalLib      = String.Format(LibraryFormatString, ConfiguredLib);
                PublicAdditionalLibraries.Add(FinalLib);
            }
        }
    }
Beispiel #8
0
    public ApexDestructionLib(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

        if (Target.bCompileAPEX == false)
        {
            return;
        }

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

        string ApexVersion = "APEX_1.4";

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

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

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

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

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


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

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

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

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

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

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

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

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

            string PhysXBinariesDir = Target.UEThirdPartyBinariesDirectory + "PhysX3/Mac";
            foreach (string Lib in DynamicLibrariesMac)
            {
                string LibraryPath = PhysXBinariesDir + String.Format(Lib, LibrarySuffix);
                PublicDelayLoadDLLs.Add(LibraryPath);
                RuntimeDependencies.Add(LibraryPath);
            }
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            if (Target.Architecture.StartsWith("x86_64"))
            {
                string PhysXBinariesDir = Target.UEThirdPartyBinariesDirectory + "PhysX3/Linux/" + Target.Architecture;
                string LibraryPath      = PhysXBinariesDir + String.Format("/libAPEX_Destructible{0}.so", LibrarySuffix);
                PublicAdditionalLibraries.Add(LibraryPath);
                RuntimeDependencies.Add(LibraryPath);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            APEXLibDir += "/PS4";
            PublicLibraryPaths.Add(APEXLibDir);

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

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

            LibraryFormatString = "{0}";
        }

        // Add the libraries needed (used for all platforms except Windows and Mac)
        if (LibraryFormatString != null)
        {
            foreach (string Lib in ApexLibraries)
            {
                string ConfiguredLib = String.Format(Lib, LibrarySuffix);
                string FinalLib      = String.Format(LibraryFormatString, ConfiguredLib);
                PublicAdditionalLibraries.Add(FinalLib);
            }
        }
    }
Beispiel #9
0
    public APEX(ReadOnlyTargetRules Target) : base(Target)
    {
        Type = ModuleType.External;

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

        string ApexVersion = "APEX_1.4";

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

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

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

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

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

        bool bIsApexStaticallyLinked = false;
        bool bHasApexLegacy          = true;

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

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

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

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

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

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

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

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

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

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

            string PhysXBinariesDir = Target.UEThirdPartyBinariesDirectory + "PhysX3/Mac";
            foreach (string Lib in DynamicLibrariesMac)
            {
                string LibraryPath = PhysXBinariesDir + String.Format(Lib, LibrarySuffix);
                PublicDelayLoadDLLs.Add(LibraryPath);
                RuntimeDependencies.Add(LibraryPath);
            }
            if (LibrarySuffix != "")
            {
                PublicDefinitions.Add("UE_APEX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
        {
            if (Target.Architecture.StartsWith("x86_64"))
            {
                ApexLibraries.Clear();
                string PhysXBinariesDir = Target.UEThirdPartyBinariesDirectory + "PhysX3/Linux/" + Target.Architecture;
                PrivateRuntimeLibraryPaths.Add(PhysXBinariesDir);

                string[] DynamicLibrariesLinux =
                {
                    "/libApexCommon{0}.so",
                    "/libApexFramework{0}.so",
                    "/libApexShared{0}.so",
                    "/libAPEX_Legacy{0}.so",
                    "/libAPEX_Clothing{0}.so",
                    "/libNvParameterized{0}.so",
                    "/libRenderDebug{0}.so"
                };

                foreach (string RuntimeDependency in DynamicLibrariesLinux)
                {
                    string LibraryPath = PhysXBinariesDir + String.Format(RuntimeDependency, LibrarySuffix);
                    PublicAdditionalLibraries.Add(LibraryPath);
                    RuntimeDependencies.Add(LibraryPath);
                }
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            bIsApexStaticallyLinked = true;
            bHasApexLegacy          = false;

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

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

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

            PublicDefinitions.Add("_XBOX_ONE=1");

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

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

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

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

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

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

            LibraryFormatString = "{0}";
        }

        PublicDefinitions.Add("APEX_UE4=1");

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

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

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

        Definitions.Add("WITH_APEX=1");

        string ApexVersion = "APEX_1.4";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            string PhysXBinariesDir = UEBuildConfiguration.UEThirdPartyBinariesDirectory + "PhysX/Mac";
            foreach (string Lib in DynamicLibrariesMac)
            {
                string LibraryPath = PhysXBinariesDir + String.Format(Lib, LibrarySuffix);
                PublicDelayLoadDLLs.Add(LibraryPath);
                RuntimeDependencies.Add(new RuntimeDependency(LibraryPath));
            }
            if (LibrarySuffix != "")
            {
                Definitions.Add("UE_APEX_SUFFIX=" + LibrarySuffix);
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            if (Target.Architecture != "arm-unknown-linux-gnueabihf")
            {
                APEXLibDir += "/Linux/" + Target.Architecture;
                Definitions.Add("APEX_STATICALLY_LINKED=1");

                ApexLibraries.Add("APEX_Clothing{0}");
                ApexLibraries.Add("APEX_Destructible{0}");
                ApexLibraries.Add("APEX_Legacy{0}");
                ApexLibraries.Add("ApexFramework{0}");
                LibraryFormatString = APEXLibDir + "/lib{0}" + ".a";
            }
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            Definitions.Add("APEX_STATICALLY_LINKED=1");
            Definitions.Add("WITH_APEX_LEGACY=0");

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

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

            LibraryFormatString = "{0}";
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            Definitions.Add("APEX_STATICALLY_LINKED=1");
            Definitions.Add("WITH_APEX_LEGACY=0");
            Definitions.Add("_XBOX_ONE=1");

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

            APEXLibDir += "/XboxOne/VS" + WindowsPlatform.GetVisualStudioCompilerVersionName();
            PublicLibraryPaths.Add(APEXLibDir);

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

            LibraryFormatString = "{0}.lib";
        }
        else if (Target.Platform == UnrealTargetPlatform.Switch)
        {
            Definitions.Add("APEX_STATICALLY_LINKED=1");
            Definitions.Add("WITH_APEX_LEGACY=0");

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

            LibraryFormatString = "{0}";
        }

        Definitions.Add("APEX_UE4=1");

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

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

        Definitions.Add("WITH_APEX=1");

        string APEXDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "PhysX/APEX-1.3/";

        string APEXLibDir = APEXDir + "lib";

        PublicSystemIncludePaths.AddRange(
            new string[] {
            APEXDir + "public",
            APEXDir + "framework/public",
            APEXDir + "framework/public/PhysX3",
            APEXDir + "module/destructible/public",
            APEXDir + "module/clothing/public",
            APEXDir + "module/legacy/public",
            APEXDir + "NxParameterized/public",
        }
            );

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

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

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

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

            PublicAdditionalLibraries.Add(String.Format("APEXFramework{0}_x86.lib", LibrarySuffix));
            PublicDelayLoadDLLs.Add(String.Format("APEXFramework{0}_x86.dll", LibrarySuffix));
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            APEXLibDir += "/osx64";
            Definitions.Add("APEX_STATICALLY_LINKED=1");

            ApexLibraries.Add("APEX_Legacy{0}");
            ApexLibraries.Add("APEX_Loader{0}");

            LibraryFormatString = APEXLibDir + "/lib{0}" + ".a";
        }
        else if (Target.Platform == UnrealTargetPlatform.Linux)
        {
            APEXLibDir += "/Linux/" + Target.Architecture;
            Definitions.Add("APEX_STATICALLY_LINKED=1");

            ApexLibraries.Add("APEX_Legacy{0}");
            ApexLibraries.Add("APEX_Loader{0}");

            LibraryFormatString = APEXLibDir + "/lib{0}" + ".a";
        }
        else if (Target.Platform == UnrealTargetPlatform.PS4)
        {
            Definitions.Add("APEX_STATICALLY_LINKED=1");
            Definitions.Add("WITH_APEX_LEGACY=0");

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

            LibraryFormatString = "{0}";
        }
        else if (Target.Platform == UnrealTargetPlatform.XboxOne)
        {
            Definitions.Add("APEX_STATICALLY_LINKED=1");
            Definitions.Add("WITH_APEX_LEGACY=0");

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

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

            LibraryFormatString = "{0}.lib";
        }

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