diff options
author | Steven Knight <knight@baldmt.com> | 2004-06-14 12:59:21 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-06-14 12:59:21 (GMT) |
commit | a0d7c6333aeb9b6f2848ea3c90662f91f7f8ac0e (patch) | |
tree | 006fcd23761e031e5a59922224b1364edbffdcf5 /src/engine/SCons/Tool/msvc.py | |
parent | f0eef8baab59eaf981656f5507f17c83ee096a0a (diff) | |
download | SCons-a0d7c6333aeb9b6f2848ea3c90662f91f7f8ac0e.zip SCons-a0d7c6333aeb9b6f2848ea3c90662f91f7f8ac0e.tar.gz SCons-a0d7c6333aeb9b6f2848ea3c90662f91f7f8ac0e.tar.bz2 |
Change PDB file generation from compile time to link time. (Anthony Roach)
Diffstat (limited to 'src/engine/SCons/Tool/msvc.py')
-rw-r--r-- | src/engine/SCons/Tool/msvc.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index f8d234b..3280eb5 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -349,7 +349,7 @@ def get_msvc_default_paths(version=None, use_mfc_dirs=0): return _get_msvc6_default_paths(version, use_mfc_dirs) def validate_vars(env): - """Validate the PDB, PCH, and PCHSTOP construction variables.""" + """Validate the PCH and PCHSTOP construction variables.""" if env.has_key('PCH') and env['PCH']: if not env.has_key('PCHSTOP'): raise SCons.Errors.UserError, "The PCHSTOP construction must be defined if PCH is defined." @@ -357,8 +357,7 @@ def validate_vars(env): raise SCons.Errors.UserError, "The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP'] def pch_emitter(target, source, env): - """Sets up the PDB dependencies for a pch file, and adds the object - file target.""" + """Adds the object file target.""" validate_vars(env) @@ -376,23 +375,15 @@ def pch_emitter(target, source, env): target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work - if env.has_key('PDB') and env['PDB']: - env.SideEffect(env['PDB'], target) - env.Precious(env['PDB']) - return (target, source) def object_emitter(target, source, env, parent_emitter): - """Sets up the PDB and PCH dependencies for an object file.""" + """Sets up the PCH dependencies for an object file.""" validate_vars(env) parent_emitter(target, source, env) - if env.has_key('PDB') and env['PDB']: - env.SideEffect(env['PDB'], target) - env.Precious(env['PDB']) - if env.has_key('PCH') and env['PCH']: env.Depends(target, env['PCH']) @@ -421,7 +412,7 @@ def generate(env): static_obj.add_action(suffix, SCons.Defaults.CXXAction) shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction) - env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Zi /Fd%s"%File(PDB)) or ""}']) + env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}']) env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}']) env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS' env['CC'] = 'cl' @@ -473,7 +464,8 @@ def generate(env): env['CFILESUFFIX'] = '.c' env['CXXFILESUFFIX'] = '.cc' - env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS' + env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}']) + env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS' env['BUILDERS']['PCH'] = pch_builder def exists(env): |