poco/build/script/cpp11-appleclang
2017-09-09 10:50:32 +02:00

17 lines
452 B
Bash

#! /bin/sh
#
# cpp11-appleclang
#
# Detect compatible AppleClang version and add c++11/14 flags
#
CLANGVERSION := $(shell $(CXX) -E -dM - < /dev/null | grep __apple_build_version__ | sed -e 's/^.* //g')
# C++14 needs AppleClang 500.x
ifeq ($(shell test $(CLANGVERSION) -ge 5000275 && echo 1), 1)
CXXFLAGS += -std=c++1y
# C++11 needs AppleClang 503.x
else ifeq ($(shell test $(CLANGVERSION) -ge 5030038 && echo 1), 1)
CXXFLAGS += -std=c++0x
endif