UnrealEngine/Setting

Unreal Custom Build (Github source build)

Carmada 2021. 10. 5. 17:37

1. Engine source build

 

일단 소스 다운로드
https://github.com/EpicGames/UnrealEngine/tree/4.26

 

아래로 스크롤 하면 아래 내용 나옴 따라하면 된다

다운로드 받은 파일 압축 해제 후 내부 내용 중 Setup.bat 실행 하면 파일 다운로드 함 몇분 걸림

 

다 되면 GenerateProjectFile.bat 실행 몇초 걸림

 

새로 생긴 UE4.sln 실행

 

 

Visual Studio 실행 되었다면 커스텀 세팅을 한번 하고 넘어간다

아래 링크에서 간단한 부분만 하도록함

https://docs.unrealengine.com/ko/ProductionPipelines/DevelopmentSetup/VisualStudioSetup/index.html

이제 solution configuration 을 Development Editor 로,

and your solution platform 을 Win64 로,

그리고 아래 이미지와 같이 UE4 에 우클릭 하여 빌드한다.

 

참고로 UE4 가 시작프로그램이 아니라면

아래 이미지를 참고해서 시작프로그램으로 세팅

 

 

2. Installed build

 

프로젝트 코드 수정 후 빌드시 엔진 까지 같이 빌드가 된다.

이를 방지하기 위해서 Installed build( 설치 빌드 ) 를 해야한다.

 

방법은 아래의 링크를 읽어보는 것으로 시작한다.

1. 설치 빌드 사용 안내서

https://docs.unrealengine.com/4.27/ko/ProductionPipelines/DeployingTheEngine/UsinganInstalledBuild/

 

2. BuildGraph 사용 안내서

https://docs.unrealengine.com/4.27/ko/ProductionPipelines/BuildTools/AutomationTool/BuildGraph/

 

3. 참고 블로그

https://jackknobel.com/How-To/BuildGraph

https://liveupdate.tistory.com/306

 

3번의 두번째 블로그 내용을 보고 결론적인 사용법을 알수 있지만 그전의 내용도 한번은 봐야 전체적 이해가 가능함

 

자동빌드 스크립트
위치 : ./Engine/Build/BatchFiles/RunUAT.bat

 

빌드 스크립트 실행

./RunUAT.bat BuildGraph -target="Make Installed Build Win64" -script="Engine/Build/InstalledEngineBuild.xml" -set:HostPlatformOnly=true -set:WithDDC=false -set:SignExecutables=false -clean

 

서버 타겟 추가
InstalledEngineBuild.xml 에서 "Target Platforms Win64" 에이전트아래 Compile UE4Game Win64 를 찾는다.

아래 서버 항목을 추가해준다.
<Compile Target="UE4Server" Platform="Win64" Configuration="Development" 
           Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>

<Compile Target="UE4Server" Platform="Win64" Configuration="Shipping" 
           Tag="#UE4Game Win64" Arguments="-precompile -nodebuginfo"/>

<Tag Files="Engine/Intermediate/Build/Win64/UE4Server/Inc/...;Engine/Plugins/.../Intermediate/Build/Win64/UE4Server/Inc/..."
With="#UE4Game Win64 Includes"/>

설치후 launcher에서 사용가능하도록 하기 위한 식별자 설정
레지스트리키 생성 : 아래 위치에 원하는 식별값으로 키를 생성한다.
HKEY_CURRENT_USER\\SOFTWARE\\Epic Games\UnrealEngine\Builds

 

 

 

build error 대처 방법

 

1. PDBCOPY.EXE 관련 에러

ERROR: Unable to find installation of PDBCOPY.EXE, which is required to strip symbols. This tool is included as part of the  'Windows Debugging Tools' component of the Windows 10 SDK ( https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk  )

와 같은 에러가 나온다면 링크( https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk )로 들어가서 win10sdk 설치하면 해결 됨

 

2. visual studio 2017 설치 필수

추가로 구성요소 빵빵하게 해서 설치( 기존 2019 를 쓰는 중이었음 이걸 지우진 않음 )

설치 되어있지 않으면 에러 발생함( 설치하라는 메세지와 함께 )

 

완료된 모습

중간에 한참 걸리는 로그 중에

Copying 157104 files from D:\BK\UnrealEngine\Source\UE4.26.2S to D:\BK\UnrealEngine\Source\UE4.26.2S\LocalBuilds\Engine\Windows...

이런 로그가 있고 이 경로에 우리의 설치 빌드가 자리하게 된다.

 

 

설치버전 엔진 빌드 배치 파일 내용

  -set:WithIOS=true^ 은 IOS 원격 빌드 세팅이 되어 있어야 에러가 안남

 

set UE4_PATH=D:\BK\EngineSource\4.26.2\Engine
pushd %UE4_PATH%\Build\BatchFiles
CALL RunUAT.bat BuildGraph^
 -target="Make Installed Build Win64"^
 -script=Engine/Build/InstalledEngineBuild.xml^
 -set:HostPlatformOnly=true^
 -set:WithDDC=false^
 -set:SignExecutables=false^
 -set:WithAndroid=true^

 -set:WithIOS=true^
 -clean
popd
pause