Commits

Gary Oberbrunner committed 3c54a90

Fix issue 2628, long compile lines in batch mode. Thanks to Grzegorz Bizo for the patch.

  • Participants
  • Parent commits 700298c

Comments (0)

Files changed (4)

 
 RELEASE 2.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
 
+  From Grzegorz Bizoń:
+    - Fix long compile lines in batch mode by using TEMPFILE
+
   From Justin Gullingsrud:
     - support -std=c++0x and related CXXFLAGS in pkgconfig (ParseFlags)
 
 
     - Print the path to the SCons package in scons --version
 
-  From Jean-Franois Colson:
+  From Jean-Fran�ois Colson:
 
     - Improve Microsoft Visual Studio Solution generation, and fix
       various errors in the generated solutions especially when using
 
     - Issue 2401: Fix usage of comparisons with None.
 
-  From Ludwig Hhne:
+  From Ludwig H�hne:
 
     - Handle Java inner classes declared within a method.
 
 
     - Fix VariantDir duplication of #included files in subdirectories.
 
-  From Ludwig Hhne:
+  From Ludwig H�hne:
 
     - Reduce memory usage when a directory is used as a dependency of
       another Node (such as an Alias) by returning a concatenation
 
     - Clear the Node state when turning a generic Entry into a Dir.
 
-  From Ludwig Hhne:
+  From Ludwig H�hne:
 
     - Fix sporadic output-order failures in test/GetBuildFailures/parallel.py.
 
 
   - Fix the --debug=stree option so it prints its tree once, not twice.
 
-  From Johan Boul:
+  From Johan Boul�:
 
   - Fix the ability to use LoadableModule() under MinGW.
 
     calls by using a File's .suffix attribute directly instead of
     stringifying it.
 
-  From Jérôme Berger:
+  From Jérôme Berger:
 
   - Have the D language scanner search for .di files as well as .d files.
 
   - Fix C/C++ compiler selection on AIX to not always use the external $CC
     environment variable.
 
-  From August Hörandl:
+  From August Hörandl:
 
   - Add a scanner for \include and \import files, with support for
     searching a directory list in $TEXINPUTS (imported from the external
 
   FIXES
 
+    - Long compile lines no longer break MSVC_BATCH mode
     - RPATH is now in LINKCOM rather than LINKFLAGS, so resetting
       LINKFLAGS doesn't kill RPATH
     - Precompiled headers on Windows no longer break when used with
   Thanks to
   Dirk Baechle,
   Vincent Beffara,
-  Jean-Fran�ois Colson,
+  Grzegorz Bizoń,
+  Jean-François Colson,
   Bauke Conijn,
   Bill Deegan,
   Ken Deeter,

src/engine/SCons/Tool/msvc.py

     env['CC']         = 'cl'
     env['CCFLAGS']    = SCons.Util.CLVar('/nologo')
     env['CFLAGS']     = SCons.Util.CLVar('')
-    env['CCCOM']      = '$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM'
+    env['CCCOM']      = '${TEMPFILE("$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM")}'
     env['SHCC']       = '$CC'
     env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')
     env['SHCFLAGS']   = SCons.Util.CLVar('$CFLAGS')
-    env['SHCCCOM']    = '$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM'
+    env['SHCCCOM']    = '${TEMPFILE("$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM")}'
     env['CXX']        = '$CC'
     env['CXXFLAGS']   = SCons.Util.CLVar('$( /TP $)')
-    env['CXXCOM']     = '$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM'
+    env['CXXCOM']     = '${TEMPFILE("$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM")}'
     env['SHCXX']      = '$CXX'
     env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
-    env['SHCXXCOM']   = '$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM'
+    env['SHCXXCOM']   = '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM")}'
     env['CPPDEFPREFIX']  = '/D'
     env['CPPDEFSUFFIX']  = ''
     env['INCPREFIX']  = '/I'

test/MSVC/batch-longlines.py

+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Verify operation of Visual C/C++ batch builds with long lines.
+
+Only runs on Windows.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+_python_ = TestSCons._python_
+
+for i in xrange(1,200):
+    test.write('source-file-with-quite-a-long-name-maybe-unrealistic-but-who-cares-%05d.cxx'%i,
+               '/* source file %d */\nint var%d;\n'%(i,i))
+
+test.write('SConstruct', """
+env = Environment(tools=['msvc', 'mslink'],
+                  MSVC_BATCH=ARGUMENTS.get('MSVC_BATCH'))
+env.SharedLibrary('mylib', Glob('source*.cxx'))
+""" % locals())
+
+test.run(arguments = 'MSVC_BATCH=1 .')
+
+test.must_exist('mylib.dll')
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: