From 4e0bc5d233613732b550146fb11570945f12890c Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Wed, 6 May 2015 09:52:08 +0200
Subject: Have cl.exe write debug info to independent files for reliable
 parallel builds

By default cl.exe writes debug info to a static file name resulting
in all cl.exe trying to write to the same file when using parallel
builds.
This leads to race conditions and can have parallel builds fail.

This only takes effect if parallel builds are made by scons.

Test-Information:

Tested with VS 2013.

Change-Id: I8ea7e9370f5b149ded608e4c6f5e66a3fc6301c4

diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index dd462de..ff24eeb 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -221,6 +221,9 @@ if env["debug"] :
 	if env["PLATFORM"] == "win32" :
 		env.Append(CCFLAGS = ["/Zi"])
 		env.Append(LINKFLAGS = ["/DEBUG"])
+		if GetOption("num_jobs") > 1 :
+			env["CCPDBFLAGS"] = '/Fd${TARGET}.pdb'
+			env["PDB"] = '${TARGET.base}.pdb'
 		if env["set_iterator_debug_level"] :
 			env.Append(CPPDEFINES = ["_ITERATOR_DEBUG_LEVEL=0"])
 		if env["optimize"] :
-- 
cgit v0.10.2-6-g49f6