From b567f844ad654f9b2a433e45ab00d48f4b1f950b Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 10 Feb 2015 17:50:42 -0500 Subject: [PATCH] #669 Support libc++ in macosx-sanity-check --- scripts/macosx-sanity-check.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/macosx-sanity-check.py b/scripts/macosx-sanity-check.py index b0ff68e5..eeb3ffec 100755 --- a/scripts/macosx-sanity-check.py +++ b/scripts/macosx-sanity-check.py @@ -20,6 +20,8 @@ import re DEBUG = False +cxxlib = None + def usage(): print >> sys.stderr, "Usage: " + sys.argv[0] + " " sys.exit(1) @@ -62,12 +64,17 @@ def find_dependencies(file): return None deps = output.split('\n') for dep in deps: - #print dep - # Fail if anything is linked with libc++, as that's not backwards compatible - # with Mac OS X 10.6 - if re.search("libc\+\+", dep): - print "Error: clang's libc++ is used by " + file - return None + # print dep + # Fail if libstc++ and libc++ was mixed + global cxxlib + match = re.search("lib(std)?c\+\+", dep) + if match: + if not cxxlib: + cxxlib = match.group(0) + else: + if cxxlib != match.group(0): + print "Error: Mixing libc++ and libstdc++" + return None dep = re.sub(".*:$", "", dep) # Take away header line dep = re.sub("^\t", "", dep) # Remove initial tabs dep = re.sub(" \(.*\)$", "", dep) # Remove trailing parentheses