? 日韩国产二区不卡在线,91手机看片国产永久免费
聯(lián)系我們

給我們留言

聯(lián)系我們

地址:福建省晉江市青陽(yáng)街道洪山路國(guó)際工業(yè)設(shè)計(jì)園納金網(wǎng)

郵箱:info@narkii.com

電話:0595-82682267

(周一到周五, 周六周日休息)

當(dāng)前位置:主頁(yè) > 3D教程 > 圖文教程

UE4 Project.Build.cs配置示例(UE4引用libuv靜態(tài)鏈接庫(kù)

來源: 52vr | 責(zé)任編輯:傳說的落葉 | 發(fā)布時(shí)間: 2019-06-06 08:27 | 瀏覽量:

[UE4]Project.Build.cs配置示例(UE4引用libuv靜態(tài)鏈接庫(kù))

 

這個(gè)例子演示了如何鏈接libuv靜態(tài)庫(kù)相關(guān)的配置。

libuv版本是v1.8

 
  1. // Fill out your copyright notice in the Description page of Project Settings.  
  2.   
  3. using System.IO;  
  4. using UnrealBuildTool;  
  5.   
  6. public class HuaiKXSrv : ModuleRules  
  7. {  
  8.     private string ModulePath  
  9.     {  
  10.         get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }  
  11.     }  
  12.   
  13.     private string ThirdPartyPath  
  14.     {  
  15.         get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }  
  16.     }  
  17.   
  18.   
  19.     public HuaiKXSrv(TargetInfo Target)  
  20.     {  
  21.         PublicDependencyModuleNames.AddRange(new string[] { "Core""CoreUObject""Engine""InputCore" });  
  22.   
  23.         PrivateDependencyModuleNames.AddRange(new string[] {  });  
  24.   
  25.         // Uncomment if you are using Slate UI  
  26.         // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });  
  27.   
  28.         // Uncomment if you are using online features  
  29.         // PrivateDependencyModuleNames.Add("OnlineSubsystem");  
  30.         // if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))  
  31.         // {  
  32.         //      if (UEBuildConfiguration.bCompileSteamOSS == true)  
  33.         //      {  
  34.         //          DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");  
  35.         //      }  
  36.         // }  
  37.   
  38.         AddDefines(Target);  
  39.   
  40.         LoadLibuv(Target);  
  41.     }  
  42.   
  43.     public void AddDefines(TargetInfo Target)  
  44.     {  
  45.         if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))  
  46.         {  
  47.             Definitions.Add("_IS_WINDOWS_");  
  48.         }  
  49.         else  
  50.         {  
  51.             Definitions.Add("_IS_LINUX_");  
  52.         }  
  53.     }  
  54.   
  55.     //鏈接libuv  
  56.     public bool LoadLibuv(TargetInfo Target)  
  57.     {  
  58.         bool isLibrarySupported = false;  
  59.   
  60.         //libuv需要的系統(tǒng)lib  
  61.         PublicAdditionalLibraries.Add("IPHLPAPI.lib");  
  62.         PublicAdditionalLibraries.Add("Psapi.lib");  
  63.         PublicAdditionalLibraries.Add("userenv.lib");  
  64.         PublicAdditionalLibraries.Add("msvcrtd.lib");  
  65.   
  66.         if (Target.Configuration == UnrealTargetConfiguration.Debug || Target.Configuration == UnrealTargetConfiguration.DebugGame)  
  67.         {  
  68.             if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))  
  69.             {  
  70.                 isLibrarySupported = true;  
  71.   
  72.                 string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "D.x64" : "D.x86";  
  73.                 string LibrariesPath = Path.Combine(ThirdPartyPath, "Libuv""Libraries");  
  74.   
  75.                 string LibuvLibPath = Path.Combine(LibrariesPath, "libuv" + PlatformString + ".lib");  
  76.                 PublicAdditionalLibraries.Add(LibuvLibPath);  
  77.                 System.Console.WriteLine("#### Set Debug Libuv Libraries ####:" + LibuvLibPath);  
  78.             }  
  79.         }  
  80.         else if (Target.Configuration == UnrealTargetConfiguration.Shipping || Target.Configuration == UnrealTargetConfiguration.Development)  
  81.         {  
  82.             if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))  
  83.             {  
  84.                 isLibrarySupported = true;  
  85.   
  86.                 string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "x86";  
  87.                 string LibrariesPath = Path.Combine(ThirdPartyPath, "Libuv""Libraries");  
  88.   
  89.                 string LibuvLibPath = Path.Combine(LibrariesPath, "libuv." + PlatformString + ".lib");  
  90.                 PublicAdditionalLibraries.Add(LibuvLibPath);  
  91.                 System.Console.WriteLine("#### Set Shipping Libuv Libraries ####:" + LibuvLibPath);  
  92.             }  
  93.         }  
  94.   
  95.         if (isLibrarySupported)  
  96.         {  
  97.             System.Console.WriteLine("#### Set Libuv Includes ####:" + Path.Combine(ThirdPartyPath, "Libuv""Includes"));  
  98.             // Include path  
  99.             PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Libuv""Includes"));  
  100.         }  
  101.   
  102.         //Definitions.Add(string.Format("WITH_BOBS_MAGIC_BINDING={0}", isLibrarySupported ? 1 : 0));  
  103.   
  104.         return isLibrarySupported;  
  105.     }  
  106. }  

 


相關(guān)文章
網(wǎng)友評(píng)論

您需要登錄后才可以發(fā)帖 登錄 | 立即注冊(cè)

關(guān)閉

全部評(píng)論:0條

推薦
熱門