Check CC environment variable

This commit is contained in:
Joakim Hove
2019-09-17 14:16:55 +02:00
parent efe7a97b1d
commit b7459231d2
2 changed files with 9 additions and 6 deletions

View File

@@ -36,15 +36,16 @@ if setupdir != '':
os.chdir( setupdir )
try:
subprocess.call(["c++", "--version"])
subprocess.call(['ccache', '--version'])
os.environ['CC'] = 'ccache c++'
subprocess.call(['ccache', '--version'])
cc = os.environ.get("CC", "c++")
os.environ['CC'] = 'ccache {}'.format(cc)
print("Using 'ccache {}' as compiler".format(cc))
except OSError as e:
print('\nNOTE: please install ccache for faster compilation of python bindings.\n')
print('\nNOTE: please install ccache for faster compilation of python bindings.\n')
if 'build' in sys.argv:
if not 'build_ext' in sys.argv:
raise TypeError("Missing option 'build_ext'.")
if not 'build_ext' in sys.argv:
raise TypeError("Missing option 'build_ext'.")
ext_modules = [
Extension(