summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2019-04-20 02:02:13 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2019-04-20 02:02:13 (GMT)
commit1a98847cf341370f2bc9224d4e43ce62e679d74a (patch)
treef0ef3de35591ffa7ba989fb6161ed2c1b50626f2 /src/engine
parenta892ff25ef22819b9aa50a5bc64268c5722250b4 (diff)
downloadSCons-1a98847cf341370f2bc9224d4e43ce62e679d74a.zip
SCons-1a98847cf341370f2bc9224d4e43ce62e679d74a.tar.gz
SCons-1a98847cf341370f2bc9224d4e43ce62e679d74a.tar.bz2
Issue #3350 - Add TEMPFILEARGJOINBYTE as a variable to be used to join each item placed into a TEMPFILE. Previously hardcoded as a bytearray space, now it is overridden by msvc and mslink tools
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Defaults.py1
-rw-r--r--src/engine/SCons/Platform/__init__.py3
-rw-r--r--src/engine/SCons/Tool/mslink.py6
-rw-r--r--src/engine/SCons/Tool/msvc.py6
4 files changed, 15 insertions, 1 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index 479ef7e..e01b8a0 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -582,6 +582,7 @@ ConstructionEnvironment = {
'__DSHLIBVERSIONFLAGS' : '${__libversionflags(__env__,"DSHLIBVERSION","_DSHLIBVERSIONFLAGS")}',
'TEMPFILE' : NullCmdGenerator,
+ 'TEMPFILEARGJOINBYTE': bytearray(' '),
'Dir' : Variable_Method_Caller('TARGET', 'Dir'),
'Dirs' : Variable_Method_Caller('TARGET', 'Dirs'),
'File' : Variable_Method_Caller('TARGET', 'File'),
diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py
index e06eb0f..068ab89 100644
--- a/src/engine/SCons/Platform/__init__.py
+++ b/src/engine/SCons/Platform/__init__.py
@@ -226,7 +226,8 @@ class TempFileMunge(object):
prefix = '@'
args = list(map(SCons.Subst.quote_spaces, cmd[1:]))
- os.write(fd, bytearray(" ".join(args) + "\n",'utf-8'))
+ join_char = env.subst('TEMPFILEARGJOINBYTE')
+ os.write(fd, bytearray(join_char.join(args) + "\n",'utf-8'))
os.close(fd)
# XXX Using the SCons.Action.print_actions value directly
# like this is bogus, but expedient. This class should
diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py
index c8b00d2..176eb79 100644
--- a/src/engine/SCons/Tool/mslink.py
+++ b/src/engine/SCons/Tool/mslink.py
@@ -327,6 +327,12 @@ def generate(env):
env['LDMODULEEMITTER'] = [ldmodEmitter]
env['LDMODULECOM'] = compositeLdmodAction
+ # Issue #3350
+ # Change tempfile argument joining character from a bytearray space to a newline
+ # mslink will fail if any single line is too long, but is fine with many lines
+ # in a tempfile
+ env['TEMPFILEARGJOINBYTE'] = bytearray('\n')
+
def exists(env):
return msvc_exists(env)
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index 6cfa245..91ffa33 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -283,6 +283,12 @@ def generate(env):
msvc_set_PCHPDBFLAGS(env)
+ # Issue #3350
+ # Change tempfile argument joining character from a bytearray space to a newline
+ # mslink will fail if any single line is too long, but is fine with many lines
+ # in a tempfile
+ env['TEMPFILEARGJOINBYTE'] = bytearray('\n')
+
env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
env['BUILDERS']['PCH'] = pch_builder