summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2015-04-29 19:44:16 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2015-04-29 19:44:16 (GMT)
commitd91c07560606203f3fba4384b2c94c2e4e39d434 (patch)
treef9c1d4087dd188ab57c85ceb8e6b34d4c0c83c34 /src
parent08eae186d3237d214b5db70af9e54360002701e4 (diff)
parentdf36b18d410042510239fe10b00022a88a1095d7 (diff)
downloadSCons-d91c07560606203f3fba4384b2c94c2e4e39d434.zip
SCons-d91c07560606203f3fba4384b2c94c2e4e39d434.tar.gz
SCons-d91c07560606203f3fba4384b2c94c2e4e39d434.tar.bz2
Merged in feblot/scons-feblot/pchdll (pull request #232)
VC11 needs PCH objects added to the link line also for shared libraries.
Diffstat (limited to 'src')
-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.