Unreal Engine 4源码编译技巧
Step1:修改Setup.bat,并运行,下载所需要的依赖
打开Setup.bat,在第9行,--prompt 后面添加内容
-
--exclude=<XXX> (这些选项前的双横线也可以用单横线)非常有用,减少不必要的文件下载。可以排除掉自己不需要的平台和VS版本,
-
例如: setup.bat -exclude=Linux -exclude=IOS -exclude=HTML5 -exclude=Android -exclude=VS2013 -
平台可选的参数:Win32、Win64、osx32、osx64、Linux、Android、IOS、HTML5 -
VS版本可选参数:VS2012、VS2013、VS2015 -
警告: 不要排除Win32 和 VS2012 ,不然后期编译会遇到问题 -
--threads=<N>
- 可以多线程下载,速度倍增。例如:
setup.bat --threads=20 -
--cache=<PATH>
- 可以把下载的内容缓存在指定的目录,这样如果有多人需要,就可以只下载一次,然后分享给大家,
- 例如:
setup.bat --cache=D:\Temp -
--proxy=<user:password@url>
@echo off
setlocal
pushd "%~dp0"
rem Figure out if we should append the -prompt argument
set PROMPT_ARGUMENT=
for %%P in (%*) do if /I "%%P" == "--prompt" goto no_prompt_argument
for %%P in (%*) do if /I "%%P" == "--force" goto no_prompt_argument
set PROMPT_ARGUMENT=--prompt
:no_prompt_argument
rem Sync the dependencies...
.\Engine\Binaries\DotNET\GitDependencies.exe %PROMPT_ARGUMENT% %*
if ERRORLEVEL 1 goto error
rem Setup the git hooks...
if not exist .git\hooks goto no_git_hooks_directory
echo Registering git hooks...
echo
echo Engine/Binaries/DotNET/GitDependencies.exe %* >>.git\hooks\post-checkout
echo
echo Engine/Binaries/DotNET/GitDependencies.exe %* >>.git\hooks\post-merge
:no_git_hooks_directory
rem Install prerequisites...
echo Installing prerequisites...
start /wait Engine\Extras\Redist\en-us\UE4PrereqSetup_x64.exe /quiet
rem Register the engine installation...
if not exist .\Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe goto :no_unreal_version_selector
.\Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe /register
:no_unreal_version_selector
rem Done!
goto :EOF
rem Error happened. Wait for a keypress before quitting.
:error
pause
Step2:运行GenerateProjectFiles.bat,创建项目文件
Step3:双击UE4.sln文件
|