diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-06-03 07:01:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-03 07:01:38 -0600 |
commit | f5fbc4ebb1df7bfb09a96dd7e1bc778cfb0268e1 (patch) | |
tree | 088c1e66a30c5e2338bcb92a5fa01483e0ad6db1 | |
parent | c7e6915c189e39bb80e7c7987ce480fff1912c4d (diff) | |
parent | 9295adca4db3d3190530ae222ac1a29bd7447621 (diff) | |
download | numpy-f5fbc4ebb1df7bfb09a96dd7e1bc778cfb0268e1.tar.gz |
Merge pull request #11089 from ahaldane/speedup_build_all_files
BLD: cleanup _configtest.o.d during build
-rw-r--r-- | numpy/distutils/command/config.py | 8 | ||||
-rw-r--r-- | numpy/distutils/unixccompiler.py | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 66d4ed58d..47bc496cf 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -101,8 +101,12 @@ Original exception was: %s, and the Compiler class was %s return ret def _compile (self, body, headers, include_dirs, lang): - return self._wrap_method(old_config._compile, lang, - (body, headers, include_dirs, lang)) + src, obj = self._wrap_method(old_config._compile, lang, + (body, headers, include_dirs, lang)) + # _compile in unixcompiler.py sometimes creates .d dependency files. + # Clean them up. + self.temp_files.append(obj + '.d') + return src, obj def _link (self, body, headers, include_dirs, diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py index 6ed5eec6f..11b2cce52 100644 --- a/numpy/distutils/unixccompiler.py +++ b/numpy/distutils/unixccompiler.py @@ -61,8 +61,9 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts raise CompileError(msg) # add commandline flags to dependency file - with open(obj + '.d', 'a') as f: - f.write(_commandline_dep_string(cc_args, extra_postargs, pp_opts)) + if deps: + with open(obj + '.d', 'a') as f: + f.write(_commandline_dep_string(cc_args, extra_postargs, pp_opts)) replace_method(UnixCCompiler, '_compile', UnixCCompiler__compile) |