[Lldb-commits] [lldb] r187080 - Fix test suite make so that -std=c++11 gets set properly for supported compilers and -std=c++0x gets set only for gcc 4.6 versions. Previously, -std=c++0x was being set for all compilers.

Matt Kopec Matt.Kopec at intel.com
Wed Jul 24 14:39:24 PDT 2013


Author: mkopec
Date: Wed Jul 24 16:39:24 2013
New Revision: 187080

URL: http://llvm.org/viewvc/llvm-project?rev=187080&view=rev
Log:
Fix test suite make so that -std=c++11 gets set properly for supported compilers and -std=c++0x gets set only for gcc 4.6 versions. Previously, -std=c++0x was being set for all compilers.

Modified:
    lldb/trunk/test/make/Makefile.rules

Modified: lldb/trunk/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=187080&r1=187079&r2=187080&view=diff
==============================================================================
--- lldb/trunk/test/make/Makefile.rules (original)
+++ lldb/trunk/test/make/Makefile.rules Wed Jul 24 16:39:24 2013
@@ -96,12 +96,6 @@ LDFLAGS += $(LD_EXTRAS)
 OBJECTS =
 EXE ?= a.out
 
-ifneq (,$(findstring g++,$(CXX)))
-	# GCC 4.6 cannot handle -std=c++11, so replace it with -std=c++0x
-	# instead. FIXME: remove once GCC version is upgraded.
-	override CXXFLAGS := $(subst -std=c++11,-std=c++0x,$(CXXFLAGS))
-endif
-
 ifneq "$(DYLIB_NAME)" ""
 	ifeq "$(OS)" "Darwin"
 		DYLIB_FILENAME = lib$(DYLIB_NAME).dylib
@@ -224,6 +218,17 @@ ifneq "$(strip $(ARCHIVE_OBJCXX_SOURCES)
 	endif
 endif
 
+#----------------------------------------------------------------------
+# Check if we are compiling with gcc 4.6
+#----------------------------------------------------------------------
+ifneq (,$(filter g++,$(CXX)))
+	CXXVERSION = $(shell g++ -dumpversion | cut -b 1-3)
+	ifeq "$(CXXVERSION)" "4.6"
+                # GCC 4.6 cannot handle -std=c++11, so replace it with -std=c++0x
+                # instead. FIXME: remove once GCC version is upgraded.
+		override CXXFLAGS := $(subst -std=c++11,-std=c++0x,$(CXXFLAGS))
+	endif
+endif
 
 #----------------------------------------------------------------------
 # DYLIB_ONLY variable can be used to skip the building of a.out.





More information about the lldb-commits mailing list