Files
UnrealEngineUWP/Engine/Build/BatchFiles/GenerateProjectFiles.bat
Ben Marsh 878ea7019e Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3125471)
#lockdown Nick.Penwarden
#rb none

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3105904 on 2016/08/30 by Ben.Marsh

	PR #2691: Copy .map-file to staging & cleanup (Contributed by projectgheist)

Change 3105974 on 2016/08/30 by Ben.Marsh

	PR #2748: [Bug-Fix] UGS - Ensure older events do not trample newer ones (Contributed by paulevans)

Change 3106035 on 2016/08/30 by Ben.Marsh

	PR #2746: [Bug-Fix] UGS - Starting build colour was the same as disabled (Contributed by paulevans)

Change 3106172 on 2016/08/30 by Ben.Marsh

	UAT: Do not default to submitting build products from BuildCookRun unless -submit is explicitly specified on the command line.

	#codreview Maciej.Mroz

Change 3107642 on 2016/08/31 by Matthew.Griffin

	More Monolithic editor fixes
	Fixed IMPLEMENT_MODULE macros with incorrect module name
	Wrapped some usages of GIsHotReload in WITH_HOT_RELOAD
	Fixed NiagaraConstants so that they can be used in multiple modules

Change 3107808 on 2016/08/31 by Matthew.Griffin

	Added Node to Compile UAT on Mac to catch any Mono failures which will run as part of monolithics aggregate

Change 3111527 on 2016/09/02 by Matthew.Griffin

	Duplicating CL#3111524 from Release-4.13 stream
	Including Documentation/Extras in installed build

Change 3117683 on 2016/09/08 by Ben.Marsh

	PR #2771: Fix compilation of C# projects on case-sensitive OSes (Contributed by slonopotamus)

Change 3119707 on 2016/09/09 by Ben.Marsh

	UBT: Add more explicit methods for querying Visual C++ and Visual Studio installation directories. Now uses the same logic in the Visual Studio batch files.

Change 3120824 on 2016/09/12 by Ben.Marsh

	UnrealGameSync: Add a project-wide option which can disable using the last code changelist for version files, and use the sync changelist instead. ("VersionToLastCodeChange" in the "[Options]" section). Update version to 1.80.

Change 3120996 on 2016/09/12 by Ben.Marsh

	Core: Fix lines of output text from FMonitoredProcess being truncated at 512 characters, due to pipe buffer size. Accumulate incomplete lines and merge them together again instead. Also remove CR-LF pairs if they occur at the end of a line.

	#jira UE-35659

Change 3121353 on 2016/09/12 by Ben.Marsh

	Core: Manually enumerate and load dependent DLLs for modules by the editor, to work around limitations in the number of search paths checked by the Windows loader. We previously temporarily modified the PATH environment variable to provide this functionality, but are close to the OS limit for length of that string. This method should not have any such restrictions (though it will not work for circular dependencies).

Change 3121996 on 2016/09/12 by Ben.Marsh

	Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced).

	* Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result.
	* Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default.
	* Visual Studio source code accessor can talk to VS 2017 instances.
	* Added a VS2017 configuration for UnrealVS, and added precompiled vsix package.
	* Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express).
	* Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes.

	Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed.

Change 3123144 on 2016/09/13 by Ben.Marsh

	BuildGraph: Fix exception due to mismatched argument lists.

Change 3123160 on 2016/09/13 by Ben.Marsh

	Linux: Make PLATFORM_SUPPORTS_JEMALLOC a globally defined macro rather than just defined by the jemalloc module. Core supplies a default value for this macro which is inconsistent unless your module has an explicit dependency on jemalloc.

Change 3123211 on 2016/09/13 by Ben.Marsh

	UBT: Fix exception writing a version manifest if the output directory does not exist.

Change 3125300 on 2016/09/14 by Ben.Marsh

	UnrealVS: Few fixes to single-file compile command.

	* All documents are now saved before compile starts.
	* Now gives a useful error when trying to compile non-cpp files, rather than falling back to the invalid default command handler.
	* Trying to do a single-file compile while an existing build is running now prompts to stop it, rather than falling back to the default command handler (which gives a "Invalid command" message for makefile projects)

Change 3125437 on 2016/09/14 by Ben.Marsh

	UnrealVS: Update version number to 1.43 in order to prevent installer from bailing unless existing version is uninstalled first.

[CL 3126342 by Ben Marsh in Main branch]
2016-09-15 08:33:13 -04:00

152 lines
5.7 KiB
Batchfile

@echo off
setlocal
echo Setting up Unreal Engine 4 project files...
rem ## Unreal Engine 4 Visual Studio project setup script
rem ## Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
rem ## This script is expecting to exist in the UE4 root directory. It will not work correctly
rem ## if you copy it to a different location and run it.
rem ## First, make sure the batch file exists in the folder we expect it to. This is necessary in order to
rem ## verify that our relative path to the /Engine/Source directory is correct
if not exist "%~dp0..\..\Source" goto Error_BatchFileInWrongLocation
rem ## Change the CWD to /Engine/Source. We always need to run UnrealBuildTool from /Engine/Source!
pushd "%~dp0..\..\Source"
if not exist ..\Build\BatchFiles\GenerateProjectFiles.bat goto Error_BatchFileInWrongLocation
rem ## Check to make sure that we have a Binaries directory with at least one dependency that we know that UnrealBuildTool will need
rem ## in order to run. It's possible the user acquired source but did not download and unpack the other prerequiste binaries.
if not exist ..\Binaries\DotNET\RPCUtility.exe goto Error_MissingBinaryPrerequisites
set MSBUILD_EXE=msbuild.exe
rem ## Check to see if we're already running under a Visual Studio environment shell
if not "%INCLUDE%" == "" if not "%LIB%" == "" goto ReadyToCompile
rem ## Try to get the MSBuild executable directly (see https://msdn.microsoft.com/en-us/library/hh162058(v=vs.120).aspx)
if exist "%ProgramFiles%\MSBuild\14.0\bin\MSBuild.exe" (
set MSBUILD_EXE="%ProgramFiles%\MSBuild\14.0\bin\MSBuild.exe"
goto ReadyToCompile
)
if exist "%ProgramFiles(x86)%\MSBuild\14.0\bin\MSBuild.exe" (
set MSBUILD_EXE="%ProgramFiles(x86)%\MSBuild\14.0\bin\MSBuild.exe"
goto ReadyToCompile
)
rem ## Check for Visual Studio 2017
pushd %~dp0
call GetVSComnToolsPath 15
popd
if "%VsComnToolsPath%" == "" goto NoVisualStudio2017Environment
rem ## Check if the C++ toolchain is not installed
if not exist "%VsComnToolsPath%/../IDE/VC/bin/x86_amd64/vcvarsx86_amd64.bat" goto NoVisualStudio2017Environment
call "%VsComnToolsPath%/../IDE/VC/bin/x86_amd64/vcvarsx86_amd64.bat" >NUL
goto ReadyToCompile
:NoVisualStudio2017Environment
rem ## Check for Visual Studio 2015
pushd %~dp0
call GetVSComnToolsPath 14
popd
if "%VsComnToolsPath%" == "" goto NoVisualStudio2015Environment
rem ## Check if the C++ toolchain is not installed
if not exist "%VsComnToolsPath%/../../VC/bin/x86_amd64/vcvarsx86_amd64.bat" goto NoVisualStudio2015Environment
call "%VsComnToolsPath%/../../VC/bin/x86_amd64/vcvarsx86_amd64.bat" >NUL
goto ReadyToCompile
:NoVisualStudio2015Environment
rem ## Check for Visual Studio 2013
pushd %~dp0
call GetVSComnToolsPath 12
popd
if "%VsComnToolsPath%" == "" goto NoVisualStudio2013Environment
call "%VsComnToolsPath%/../../VC/bin/x86_amd64/vcvarsx86_amd64.bat" >NUL
goto ReadyToCompile
:NoVisualStudio2013Environment
rem ## User has no version of Visual Studio installed?
goto Error_NoVisualStudioEnvironment
:ReadyToCompile
rem Check to see if the files in the UBT directory have changed. We conditionally include platform files from the .csproj file, but MSBuild doesn't recognize the dependency when new files are added.
md ..\Intermediate\Build >nul 2>nul
dir /s /b Programs\UnrealBuildTool\*.cs >..\Intermediate\Build\UnrealBuildToolFiles.txt
fc /b ..\Intermediate\Build\UnrealBuildToolFiles.txt ..\Intermediate\Build\UnrealBuildToolPrevFiles.txt >nul 2>nul
if not errorlevel 1 goto SkipClean
copy /y ..\Intermediate\Build\UnrealBuildToolFiles.txt ..\Intermediate\Build\UnrealBuildToolPrevFiles.txt >nul
%MSBUILD_EXE% /nologo /verbosity:quiet Programs\UnrealBuildTool\UnrealBuildTool.csproj /property:Configuration=Development /property:Platform=AnyCPU /target:Clean
:SkipClean
%MSBUILD_EXE% /nologo /verbosity:quiet Programs\UnrealBuildTool\UnrealBuildTool.csproj /property:Configuration=Development /property:Platform=AnyCPU /target:Build
if not %ERRORLEVEL% == 0 goto Error_UBTCompileFailed
rem ## Run UnrealBuildTool to generate Visual Studio solution and project files
rem ## NOTE: We also pass along any arguments to the GenerateProjectFiles.bat here
..\Binaries\DotNET\UnrealBuildTool.exe -ProjectFiles %*
if not %ERRORLEVEL% == 0 goto Error_ProjectGenerationFailed
rem ## Success!
popd
exit /B 0
:Error_BatchFileInWrongLocation
echo.
echo GenerateProjectFiles ERROR: The batch file does not appear to be located in the /Engine/Build/BatchFiles directory. This script must be run from within that directory.
echo.
pause
goto Exit
:Error_MissingBinaryPrerequisites
echo.
echo GenerateProjectFiles ERROR: It looks like you're missing some files that are required in order to generate projects. Please check that you've downloaded and unpacked the engine source code, binaries, content and third-party dependencies before running this script.
echo.
pause
goto Exit
:Error_NoVisualStudioEnvironment
echo.
echo GenerateProjectFiles ERROR: We couldn't find a valid installation of Visual Studio. This program requires Visual Studio 2015. Please check that you have Visual Studio installed, then verify that the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\InstallDir (or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0\InstallDir on 32-bit machines) registry value is set. Visual Studio configures this value when it is installed, and this program expects it to be set to the '\Common7\IDE\' sub-folder under a valid Visual Studio installation directory.
echo.
pause
goto Exit
:Error_UBTCompileFailed
echo.
echo GenerateProjectFiles ERROR: UnrealBuildTool failed to compile.
echo.
pause
goto Exit
:Error_ProjectGenerationFailed
echo.
echo GenerateProjectFiles ERROR: UnrealBuildTool was unable to generate project files.
echo.
pause
goto Exit
:Exit
rem ## Restore original CWD in case we change it
popd
exit /B 1