Used: Visual Studio 2013 Professional on Window 7 Professional with Service Pack 1
When compiling the first newly created project it builds the engine from sources even if the engine was built.
Repro steps:
Get the sources from github, generate project files and run the solution.
Right click on UE4 project and Build. (Win64, Development Editor)
Open Unreal Engine Editor ([Engine_Directory]\Engine\Binaries\Win64\UE4Editor.exe)
Create new Basic Code (name for example: NewGame) in [Engine_Directory]
Right click on NewGame project and Build (Win64, Development Editor)
See that the entire engine is building again.
Desired effect:
The engine is not building again, because it just has been built. Only project builds.
More details:
I have noticed that in UE4 solution the UE4 project in NMake has paths like: …..\Build
When the new project is created in this new project solution the UE4 project in NMake has paths like: F:\UE4\Engine\Build\
The problem is that the compiler sees this …..\Build as f:\UE4\Engine\Build
f:\ vs F:\ ← Unreal Build Tool seems to see them differently.
I used Notepad++ to the fast change of F:\ into f:\ in all files in [Engine_Directory]\NewGame\Intermediate\ProjectFiles and it helped.
It might be kinda dangerous when pure UE4 solution builds using slightly different paths than project solution with the Engine.
I made a few attempts to reproduce this issue today, and was not successful. With the exception of about eight .lib and .dll files, the only thing that was built after step 5 was the NewGame project. The only way I was able to get the Engine to build again in step 5 was to change the solution configuration to Debug Editor. Do you have any additional information that might help reproduce this?
I cloned branch 4.4 once again (for sure), copied Required_1of2.zip and Required_2of2.zip, generate solution using GenerateProjectFiles.bat and tried again but nothing has changed.
Few things I didn’t mention:
Before I opened the editor and created a new project I exited the solution with the engine only.
Before building a game I set the game project as a StartUp Project.
The whole engine and a game project is on disk F: which is an SSD and it is not a system disk (which is C: )
Here is an build log from compiling engine only from engine solution: link text
Here is an build log from the project compiling: link text
Here is a dxdiag (I don’t know if it will be helpful, but I’m trying to give any information): link text
The other thing is that two out of three of my colleagues has the same problem. Maybe the problem is not in the engine but in Visual Studio or the compiler configuration, but I had no idea what it could be.
I also remind that changing the size of a disk letter in vcxproj files helps. Is Unreal Build Tool case sensitive?
Sorry for the delay in getting back to you. We are still looking into this issue. A few more questions:
Does this issue only occur the first time you build the project? If you build it a second time, do you still see the Engine being built?
Do you see the same thing happening if you create a Basic Code project in a different location (not in the Engine root folder)?
Have you tried using the 4.5 Preview version of the Engine, and does the same thing happen there?
There may be something in the capitalization question, though I checked some of the vcproj files in the test project I created and they all had D:\ for the drive instead of d:\ and I haven’t been able to reproduce this issue yet.
Yes, only the first build. When I build it a second time everything if fine. Also, when I create a second project everything is ok. The issue occurs only when building the first project ever created using the engine.
Yes. I was trying to create a project into different directories and there was the same problem.
I’m working on similar issue right now (UBT does two full rebuilds when trying to compile from command line, paths differ only by capitalization). I’ll try to reproduce your problem and see if my solution works for that as well. I’ll keep you informed.
Unfortunately I wasn’t able to reproduce your problem, but I have come up with a quick test if root cause of your problem and mine are the same.
After first compilation (clean Engine only), open \Engine\Intermediate\Build\Win64\UE4Editor\Development\Engine\EnginePrivate.h. It should look something like (note that in my case disk drive letter is capital):
Follow all steps you described to create project and trigger second full rebuild.
Open \Engine\Intermediate\Build\Win64\UE4Editor\Development\Engine\EnginePrivate.h again. If disk drive letter has different capitalization than previously then it’s the same problem and I’ll fix this within a day or two. Otherwise, we’ll have to keep digging.
Thanks for finding this out and let me know if the contents of EnginePrivate.h change (note this is a temporary file in Intermediate folder, not the one in Source).
I just committed fix for that. It’ll go just to master, but the fix is very simple and you can port it to 4.5 locally. Please let me know if this helps.