Commit ad6493a4 authored by Robert Bradshaw's avatar Robert Bradshaw

Run C++11 on clang toolchain as well.

parent e2d0d129
...@@ -274,10 +274,16 @@ def update_cpp11_extension(ext): ...@@ -274,10 +274,16 @@ def update_cpp11_extension(ext):
if float(compiler_version) > 4.8: if float(compiler_version) > 4.8:
ext.extra_compile_args.append("-std=c++11") ext.extra_compile_args.append("-std=c++11")
return ext return ext
clang_verison = get_clang_version(ext.language)
if clang_verison:
ext.extra_compile_args.append("-std=c++11")
return ext
return EXCLUDE_EXT return EXCLUDE_EXT
def get_gcc_version(language): def get_cc_version(language):
""" """
finds gcc version using Popen finds gcc version using Popen
""" """
...@@ -297,7 +303,6 @@ def get_gcc_version(language): ...@@ -297,7 +303,6 @@ def get_gcc_version(language):
# Force english output # Force english output
env = os.environ.copy() env = os.environ.copy()
env['LC_MESSAGES'] = 'C' env['LC_MESSAGES'] = 'C'
matcher = re.compile(r"gcc version (\d+\.\d+)").search
try: try:
p = subprocess.Popen([cc, "-v"], stderr=subprocess.PIPE, env=env) p = subprocess.Popen([cc, "-v"], stderr=subprocess.PIPE, env=env)
except EnvironmentError: except EnvironmentError:
...@@ -306,9 +311,17 @@ def get_gcc_version(language): ...@@ -306,9 +311,17 @@ def get_gcc_version(language):
(language, os.strerror(sys.exc_info()[1].errno), cc)) (language, os.strerror(sys.exc_info()[1].errno), cc))
return None return None
_, output = p.communicate() _, output = p.communicate()
output = output.decode(locale.getpreferredencoding() or 'ASCII', 'replace') return output.decode(locale.getpreferredencoding() or 'ASCII', 'replace')
gcc_version = matcher(output)
return gcc_version
def get_gcc_version(language):
matcher = re.compile(r"gcc version (\d+\.\d+)").search
return matcher(get_cc_version(language))
def get_clang_version(language):
matcher = re.compile(r"clang-(\d+\.\d+)").search
return matcher(get_cc_version(language))
def get_openmp_compiler_flags(language): def get_openmp_compiler_flags(language):
......
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