Gary Oberbrunner avatar Gary Oberbrunner committed 5394178

Handle DOS line endings in RC scanner. Fixes #2747.

Comments (0)

Files changed (4)

 
 RELEASE 2.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
 
+  From Anton Lazarev:
+    - Fix Windows resource compiler scanner to accept DOS line endings.
+
   From Matthias:
     - Update MSVS documents to remove note indicating that only one
       project is currently supported per solution file.
 
   FIXES
 
+    - Windows resource compiler (RC) scanner now handles DOS line endings
     - Visual Studio project generation now works when CPPPATH contains Dir nodes
     - Visual Studio projects are regenerated when CPPPATH or CPPDEFINES change
       NOTE: this will cause all MSVS projects to be regenerated with this version.

src/engine/SCons/Scanner/RC.py

     res_re= r'^(?:\s*#\s*(?:include)|' \
             '.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \
             '\s*.*?)' \
-            '\s*(<|"| )([^>"\s]+)(?:[>" ])*$'
+            '\s*(<|"| )([^>"\s]+)(?:[>"\s])*$'
     resScanner = SCons.Scanner.ClassicCPP( "ResourceScanner",
                                            "$RCSUFFIXES",
                                            "CPPPATH",

src/engine/SCons/Scanner/RCTests.py

 
 """)
 
+test.write('t3.rc','#include "t1.h"\r\n')
 
 # Create dummy include files
 headers = ['t1.h',
                    'testregis.rgs','testtypelib.tlb']
         deps_match(self, deps, headers)
 
+class RCScannerTestCase3(unittest.TestCase):
+    def runTest(self):
+        path = []
+        env = DummyEnvironment(RCSUFFIXES=['.rc','.rc2'],
+                               CPPPATH=path)
+        s = SCons.Scanner.RC.RCScan()
+        deps = s(env.File('t3.rc'), env, path)
+        headers = ['t1.h']
+        deps_match(self, deps, headers)
         
 
 def suite():
     suite = unittest.TestSuite()
     suite.addTest(RCScannerTestCase1())
     suite.addTest(RCScannerTestCase2())
+    suite.addTest(RCScannerTestCase3())
     return suite
 
 if __name__ == "__main__":
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.