Gary Oberbrunner avatar Gary Oberbrunner committed ef10ec2

Applied patch from #2732: support -std=c++0x in ParseFlags

Comments (0)

Files changed (4)

 
 RELEASE 2.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
 
+  From Justin Gullingsrud:
+    - support -std=c++0x and related CXXFLAGS in pkgconfig (ParseFlags)
+
   From Vincent Beffara:
     - Support -dylib_file in pkgconfig (ParseFlags)
 
 
   IMPROVEMENTS
 
+    - ParseFlags now supports -std=c++0x and related CXXFLAGS
     - ParseFlags now supports -dylib_file from pkgconfig
     - New debugging options to print unlink/relinking of variant files
       (--debug=duplicate) and preparation of targets (--debug=prepare).
   Ken Deeter,
   Luca Falavigna,
   Alexander Goomenyuk,
+  Justin Gullingsrud,
   Steven Knight,
   Arve Knudsen,
   Jean-Baptiste Lab,

src/engine/SCons/Environment.py

             'ASFLAGS'       : SCons.Util.CLVar(''),
             'CFLAGS'        : SCons.Util.CLVar(''),
             'CCFLAGS'       : SCons.Util.CLVar(''),
+            'CXXFLAGS'      : SCons.Util.CLVar(''),
             'CPPDEFINES'    : [],
             'CPPFLAGS'      : SCons.Util.CLVar(''),
             'CPPPATH'       : [],
                 elif arg == '-mwindows':
                     dict['LINKFLAGS'].append(arg)
                 elif arg[:5] == '-std=':
-                    dict['CFLAGS'].append(arg) # C only
+                    if arg[5:].find('++')!=-1:
+                        key='CXXFLAGS'
+                    else:
+                        key='CFLAGS'
+                    dict[key].append(arg)
                 elif arg[0] == '+':
                     dict['CCFLAGS'].append(arg)
                     dict['LINKFLAGS'].append(arg)

src/engine/SCons/EnvironmentTests.py

             'ASFLAGS'       : [],
             'CFLAGS'        : [],
             'CCFLAGS'       : [],
+            'CXXFLAGS'      : [],
             'CPPDEFINES'    : [],
             'CPPFLAGS'      : [],
             'CPPPATH'       : [],
             "-Wl,-Rrpath3 " + \
             "-Wp,-cpp " + \
             "-std=c99 " + \
+            "-std=c++0x " + \
             "-framework Carbon " + \
             "-frameworkdir=fwd1 " + \
             "-Ffwd2 " + \
                                   '-pthread', '-fopenmp', '-mno-cygwin',
                                   ('-arch', 'i386'), ('-isysroot', '/tmp'),
                                   '+DD64'], repr(d['CCFLAGS'])
+        assert d['CXXFLAGS'] == ['-std=c++0x'], repr(d['CXXFLAGS'])
         assert d['CPPDEFINES'] == ['FOO', ['BAR', 'value'], 'BAZ'], d['CPPDEFINES']
         assert d['CPPFLAGS'] == ['-Wp,-cpp'], d['CPPFLAGS']
         assert d['CPPPATH'] == ['/usr/include/fum',
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.