summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Feblot <devnull@localhost>2015-04-25 12:23:26 (GMT)
committerAlexandre Feblot <devnull@localhost>2015-04-25 12:23:26 (GMT)
commit9508091845949b4bbb181a46b11032ecab8178c6 (patch)
treed461ae000ea9f5dc6bf650e6f987c92371f55bf8
parent08eae186d3237d214b5db70af9e54360002701e4 (diff)
downloadSCons-9508091845949b4bbb181a46b11032ecab8178c6.zip
SCons-9508091845949b4bbb181a46b11032ecab8178c6.tar.gz
SCons-9508091845949b4bbb181a46b11032ecab8178c6.tar.bz2
VC11 needs PCH objects added to the link line.
Update msvc linker emitter to add the PCH object to shared libraries if not already present.
-rw-r--r--src/engine/SCons/Tool/mslink.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py
index 37af34e..827161e 100644
--- a/src/engine/SCons/Tool/mslink.py
+++ b/src/engine/SCons/Tool/mslink.py
@@ -129,6 +129,14 @@ def _dllEmitter(target, source, env, paramtp):
extratargets.append(pdb)
target[0].attributes.pdb = pdb
+ if version_num >= 11.0 and env.get('PCH', 0):
+ # MSVC 11 and above need the PCH object file to be added to the link line,
+ # otherwise you get link error LNK2011.
+ pchobj = SCons.Util.splitext(str(env['PCH']))[0] + '.obj'
+ # print "prog_emitter, version %s, appending pchobj %s"%(version_num, pchobj)
+ if pchobj not in extrasources:
+ extrasources.append(pchobj)
+
if not no_import_lib and \
not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
# Append an import library to the list of targets.