Browse Source

Use C++17 compile flag when possible (#41)

master
horosin 6 years ago committed by Wenzel Jakob
parent
commit
dd10f8f823
  1. 14
      setup.py

14
setup.py

@ -52,15 +52,15 @@ def has_flag(compiler, flagname): @@ -52,15 +52,15 @@ def has_flag(compiler, flagname):
def cpp_flag(compiler):
"""Return the -std=c++[11/14] compiler flag.
"""Return the -std=c++[11/14/17] compiler flag.
The c++14 is prefered over c++11 (when it is available).
The newer version is prefered over c++11 (when it is available).
"""
if has_flag(compiler, '-std=c++14'):
return '-std=c++14'
elif has_flag(compiler, '-std=c++11'):
return '-std=c++11'
else:
flags = ['-std=c++17', '-std=c++14', '-std=c++11']
for flag in flags:
if has_flag(compiler, flag): return flag
raise RuntimeError('Unsupported compiler -- at least C++11 support '
'is needed!')

Loading…
Cancel
Save