mirror of
https://github.com/python/cpython.git
synced 2025-10-22 14:42:22 +00:00
In the 'compile()' method: preserve the directory portion of source
filenames when constructing object filenames, even if output_dir given -- eg. "foo/bar.c" will compile to "foo/bar.o" without an output_dir, and to "temp/foo/bar.o" if output_dir is "temp".
This commit is contained in:
parent
b48bc17d10
commit
49ffce173e
1 changed files with 7 additions and 2 deletions
|
@ -100,6 +100,7 @@ class UnixCCompiler (CCompiler):
|
||||||
def compile (self,
|
def compile (self,
|
||||||
sources,
|
sources,
|
||||||
output_dir=None,
|
output_dir=None,
|
||||||
|
keep_dir=0,
|
||||||
macros=None,
|
macros=None,
|
||||||
include_dirs=None,
|
include_dirs=None,
|
||||||
debug=0,
|
debug=0,
|
||||||
|
@ -134,7 +135,11 @@ class UnixCCompiler (CCompiler):
|
||||||
# don't have to recompile. (Simplistic check -- we just compare the
|
# don't have to recompile. (Simplistic check -- we just compare the
|
||||||
# source and object file, no deep dependency checking involving
|
# source and object file, no deep dependency checking involving
|
||||||
# header files. Hmmm.)
|
# header files. Hmmm.)
|
||||||
objects = self.object_filenames (sources, output_dir=output_dir)
|
objects = self.object_filenames (sources,
|
||||||
|
output_dir=output_dir,
|
||||||
|
keep_dir=keep_dir)
|
||||||
|
all_objects = copy (objects) # preserve full list to return
|
||||||
|
|
||||||
if not self.force:
|
if not self.force:
|
||||||
skipped = newer_pairwise (sources, objects)
|
skipped = newer_pairwise (sources, objects)
|
||||||
for skipped_pair in skipped:
|
for skipped_pair in skipped:
|
||||||
|
@ -169,7 +174,7 @@ class UnixCCompiler (CCompiler):
|
||||||
# Have to re-fetch list of object filenames, because we want to
|
# Have to re-fetch list of object filenames, because we want to
|
||||||
# return *all* of them, including those that weren't recompiled on
|
# return *all* of them, including those that weren't recompiled on
|
||||||
# this call!
|
# this call!
|
||||||
return self.object_filenames (orig_sources, output_dir=output_dir)
|
return all_objects
|
||||||
|
|
||||||
|
|
||||||
def _fix_link_args (self, output_dir, libraries, library_dirs):
|
def _fix_link_args (self, output_dir, libraries, library_dirs):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue