Commit da197c48 authored by John Selbie's avatar John Selbie

Force -std=gnu++11

parent c015d12e
...@@ -6,13 +6,17 @@ DEFINES := -DNDEBUG ...@@ -6,13 +6,17 @@ DEFINES := -DNDEBUG
# CLANG compiler works fine # CLANG compiler works fine
# CXX := /usr/bin/clang++ # CXX := /usr/bin/clang++
# g++ versions less than 6 will default to C++ 98 # C++ 11 compiler is required
ifeq ($(CXX),g++) # I'd prefer not to have to set this mode explicitly, but...
lessthansix := $(shell expr `g++ -dumpversion | cut -d '.' -f 1` \< 6 ) # g++ version 6 and up will default to at least C++ 14 or higher, and no need to set there
ifeq ($(lessthansix), 1) # However...
CPPSTD := -std=gnu++11 # g++ versions less than 6 support it, but require -std=c++11 or -gnu++11 passed
endif # With -std=c++11 passed, Cygwin will hide APIs such as getnetworkinfo, so gnu++11 is needed (or other macro)
endif # Even with XCode 10, Mac Clang compiler defaults to C++98
# So, short of writing a maybe-portable script that sniffs compiler support...
# Explicitly setting gnu++11 is the best (works on Clang too)
# Maybe it's time to learn CMAKE or Autoconf
CPPSTD := -std=gnu++11
STANDARD_FLAGS := -Wall -Wuninitialized STANDARD_FLAGS := -Wall -Wuninitialized
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment