Commit c2fb58c7 authored by Vitja Makarov's avatar Vitja Makarov

runtests.py: Add support for ccache

parent fd88308e
...@@ -203,6 +203,7 @@ KEEP_2X_FILES = [ ...@@ -203,6 +203,7 @@ KEEP_2X_FILES = [
COMPILER = None COMPILER = None
INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ] INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
CFLAGS = os.getenv('CFLAGS', '').split() CFLAGS = os.getenv('CFLAGS', '').split()
CCACHE = os.getenv('CYTHON_RUNTESTS_CCACHE', '').split()
BACKENDS = ['c', 'cpp'] BACKENDS = ['c', 'cpp']
...@@ -242,13 +243,15 @@ list_unchanging_dir = memoize(lambda x: os.listdir(x)) ...@@ -242,13 +243,15 @@ list_unchanging_dir = memoize(lambda x: os.listdir(x))
class build_ext(_build_ext): class build_ext(_build_ext):
def build_extension(self, ext): def build_extension(self, ext):
if ext.language == 'c++':
try: try:
try: # Py2.7+ & Py3.2+ try: # Py2.7+ & Py3.2+
compiler_obj = self.compiler_obj compiler_obj = self.compiler_obj
except AttributeError: except AttributeError:
compiler_obj = self.compiler compiler_obj = self.compiler
if ext.language == 'c++':
compiler_obj.compiler_so.remove('-Wstrict-prototypes') compiler_obj.compiler_so.remove('-Wstrict-prototypes')
if CCACHE:
compiler_obj.compiler_so = CCACHE + compiler_obj.compiler_so
except Exception: except Exception:
pass pass
_build_ext.build_extension(self, ext) _build_ext.build_extension(self, ext)
......
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