赞
踩
UE引擎编译时需要需要下载依赖,如果想要在内网环境下编译,之前的做法是在外网下载一个带有完整依赖的包到内网,但是UE在编译的过程中往往会修改文件,结果运行Setup.bat文件时会检测说,依赖存在问题。
幸运的是Setup.bat文件提供了缓存的便利,当使用cmd运行代码./Setup.bat --help
时,这时就会看到一些编译选项,其中--cahce=<dir>
就表示可以指定缓存路径,这种情况下就可以主动把依赖缓存下来。
./Setup.bat --cache=../ue_cache
,这里的ue_cache
表示的是缓存文件夹,可以自行修改。./Setup.bat --cache=../ue_cache
,就可以直接使用缓存中的安装依赖。从此再也不同担心内网编译的依赖问题了。可以直接从clone源码以后,在外网运行一次Setup.bat之后,运行Setup.bat的时候会将依赖存放进**.git中,之后切换分支或者运行Setup.bat时就会自动从.git**中加载依赖。这样直接把文件夹整体打成zip包传到内网即可
// DesktopPlatfromWindows.cpp bool FDesktopPlatformWindows::RegisterEngineInstallation(const FString &RootDir, FString &OutIdentifier) { bool bRes = false; if(IsValidRootDirectory(RootDir)) { HKEY hRootKey; if(RegCreateKeyEx(HKEY_CURRENT_USER, InstallationsSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hRootKey, NULL) == ERROR_SUCCESS) { FString NewIdentifier = FGuid::NewGuid().ToString(EGuidFormats::DigitsWithHyphensInBraces); LRESULT SetResult = RegSetValueEx(hRootKey, *NewIdentifier, 0, REG_SZ, (const BYTE*)*RootDir, (RootDir.Len() + 1) * sizeof(TCHAR)); RegCloseKey(hRootKey); if(SetResult == ERROR_SUCCESS) { OutIdentifier = NewIdentifier; bRes = true; } } } return bRes; }
修改BuildConfiguration.xml文件修改为
<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<SourceFileWorkingSet>
<Provider> none </Provider>
<RepositoryPath></RepositoryPath>
<GitPath></GitPath>
</SourceFileWorkingSet>
</Configuration>
UE5的编译需要使用到nuget包,因此内网中编译UE非常重要的一步就是设置nuget的缓存包
报错信息compile Variable 'MallocCrashOverhead' set but not used
参考链接:https://forums.unrealengine.com/t/xcode13-3-with-unreal4-26-2-create-c-project-error/508357/5?u=online_learner_uvvf4
解决方案:
-Wall
并注销所在行代码赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。