summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2018-03-01 13:42:18 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2018-03-02 10:58:21 -0500
commit1ef8e418f15120c90699cfc5c6046f50bba7926a (patch)
treeb487f36a6e7fae2d5296e1119153de59eef4155c /SConstruct
parentcbb11dfa02428333b589055229b08dc5771b5114 (diff)
downloadmongo-1ef8e418f15120c90699cfc5c6046f50bba7926a.tar.gz
SERVER-33581 New msvc-debugging-format SCons option that allow for compiling with /Zi instead of /Z7 with msvc which improves link times.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct19
1 files changed, 15 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct
index 34f7f8eb863..a16d9aaa967 100644
--- a/SConstruct
+++ b/SConstruct
@@ -495,6 +495,13 @@ add_option('android-toolchain-path',
help="Android NDK standalone toolchain path. Required when using --variables-files=etc/scons/android_ndk.vars",
)
+add_option('msvc-debugging-format',
+ choices=["codeview", "pdb"],
+ default="codeview",
+ help='Debugging format in debug builds using msvc. Codeview (/Z7) or Program database (/Zi). Default is codeview.',
+ type='choice',
+)
+
try:
with open("version.json", "r") as version_fp:
version_data = json.load(version_fp)
@@ -1570,10 +1577,14 @@ elif env.TargetOSIs('windows'):
# this would be for pre-compiled headers, could play with it later
#env.Append( CCFLAGS=['/Yu"pch.h"'] )
- # docs say don't use /FD from command line (minimal rebuild)
- # /Gy function level linking (implicit when using /Z7)
- # /Z7 debug info goes into each individual .obj file -- no .pdb created
- env.Append( CCFLAGS= ["/Z7", "/errorReport:none"] )
+ # Don't send error reports in case of internal compiler error
+ env.Append( CCFLAGS= ["/errorReport:none"] )
+
+ # Select debugging format. /Zi gives faster links but seem to use more memory
+ if get_option('msvc-debugging-format') == "codeview":
+ env['CCPDBFLAGS'] = "/Z7"
+ elif get_option('msvc-debugging-format') == "pdb":
+ env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb'
# /DEBUG will tell the linker to create a .pdb file
# which WinDbg and Visual Studio will use to resolve