summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Oliver Stöneberg <oliverst@online.de>2015-02-05 14:40:19 +0100
committer Oliver Stöneberg <oliverst@online.de>2015-02-05 14:40:19 +0100
commitaf64bda24d6325340b203a852bae59978a90c56b (patch)
tree54b93953f15a1153eb309ff6b6a7a4fc122f8d47
parentaf6aff430788ef020cc7c7c9e8f22711dfc1c4f8 (diff)
added makefile define CPP11 to compile C++ code as C++11 [Oliver Stöneberg]
-rw-r--r--makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/makefile b/makefile
index 8210ac6dbca..cd828ba16c9 100644
--- a/makefile
+++ b/makefile
@@ -281,6 +281,9 @@ BUILD_MIDILIB = 1
# uncomment to enable OpenMP optimized code
# OPENMP = 1
+# uncomment to compile c++ code as C++11
+# CPP11 = 1
+
# specify optimization level or leave commented to use the default
# (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols)
# OPTIMIZE = 3
@@ -525,7 +528,11 @@ CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS) $(INCPATH)
# we compile C-only to C89 standard with GNU extensions
# we compile C++ code to C++98 standard with GNU extensions
CONLYFLAGS += -std=gnu89
-CPPONLYFLAGS += -x c++ -std=gnu++98
+ifdef CPP11
+CPPONLYFLAGS += -x c++ -std=gnu++11
+else
+CPPONLYFLAGS += -x c++ -std=gnu++89
+endif
COBJFLAGS += -x objective-c++
# this speeds it up a bit by piping between the preprocessor/compiler/assembler