summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-06-14 12:59:21 (GMT)
committerSteven Knight <knight@baldmt.com>2004-06-14 12:59:21 (GMT)
commita0d7c6333aeb9b6f2848ea3c90662f91f7f8ac0e (patch)
tree006fcd23761e031e5a59922224b1364edbffdcf5 /src
parentf0eef8baab59eaf981656f5507f17c83ee096a0a (diff)
downloadSCons-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')
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Tool/mslink.py6
-rw-r--r--src/engine/SCons/Tool/msvc.py20
3 files changed, 11 insertions, 18 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index e2f4964..704d7b7 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -162,6 +162,9 @@ RELEASE 0.96 - XXX
- Better error messages when evaluating a construction variable
expansion yields a Python syntax error.
+ - Change the generation of PDB files when using Visual Studio from
+ compile time to link time.
+
From sam th:
- Allow SConf.CheckLib() to search a list of libraries, like the
diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py
index 5347606..c44e62b 100644
--- a/src/engine/SCons/Tool/mslink.py
+++ b/src/engine/SCons/Tool/mslink.py
@@ -91,8 +91,7 @@ def win32LibEmitter(target, source, env):
"WIN32DEFPREFIX", "WIN32DEFSUFFIX"))
if env.has_key('PDB') and env['PDB']:
- env.SideEffect(env['PDB'], target)
- env.Precious(env['PDB'])
+ target.append(env['PDB'])
if not no_import_lib and \
not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
@@ -111,8 +110,7 @@ def prog_emitter(target, source, env):
SCons.Tool.msvc.validate_vars(env)
if env.has_key('PDB') and env['PDB']:
- env.SideEffect(env['PDB'], target)
- env.Precious(env['PDB'])
+ target.append(env['PDB'])
return (target,source)
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):