mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
In compile/link methods: ensure that the directory we expect to be writing to
exists before calling the compiler/linker.
This commit is contained in:
parent
013f0c8636
commit
f1146572dd
1 changed files with 6 additions and 1 deletions
|
|
@ -159,6 +159,8 @@ class UnixCCompiler (CCompiler):
|
||||||
if extra_postargs is None:
|
if extra_postargs is None:
|
||||||
extra_postargs = []
|
extra_postargs = []
|
||||||
|
|
||||||
|
if output_dir is not None:
|
||||||
|
self.mkpath (output_dir)
|
||||||
for (source,object) in srcobj:
|
for (source,object) in srcobj:
|
||||||
self.spawn ([self.cc] + cc_args +
|
self.spawn ([self.cc] + cc_args +
|
||||||
[source, '-o', object] +
|
[source, '-o', object] +
|
||||||
|
|
@ -167,7 +169,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)
|
return self.object_filenames (orig_sources, output_dir=output_dir)
|
||||||
|
|
||||||
|
|
||||||
def _fix_link_args (self, output_dir, libraries, library_dirs):
|
def _fix_link_args (self, output_dir, libraries, library_dirs):
|
||||||
|
|
@ -226,6 +228,7 @@ class UnixCCompiler (CCompiler):
|
||||||
newer = newer_group (objects, output_filename)
|
newer = newer_group (objects, output_filename)
|
||||||
|
|
||||||
if self.force or newer:
|
if self.force or newer:
|
||||||
|
self.mkpath (os.path.dirname (output_filename))
|
||||||
self.spawn ([self.archiver,
|
self.spawn ([self.archiver,
|
||||||
self.archiver_options,
|
self.archiver_options,
|
||||||
output_filename] +
|
output_filename] +
|
||||||
|
|
@ -298,6 +301,7 @@ class UnixCCompiler (CCompiler):
|
||||||
ld_args[:0] = extra_preargs
|
ld_args[:0] = extra_preargs
|
||||||
if extra_postargs:
|
if extra_postargs:
|
||||||
ld_args.extend (extra_postargs)
|
ld_args.extend (extra_postargs)
|
||||||
|
self.mkpath (os.path.dirname (output_filename))
|
||||||
self.spawn ([self.ld_shared] + ld_args)
|
self.spawn ([self.ld_shared] + ld_args)
|
||||||
else:
|
else:
|
||||||
self.announce ("skipping %s (up-to-date)" % output_filename)
|
self.announce ("skipping %s (up-to-date)" % output_filename)
|
||||||
|
|
@ -340,6 +344,7 @@ class UnixCCompiler (CCompiler):
|
||||||
ld_args[:0] = extra_preargs
|
ld_args[:0] = extra_preargs
|
||||||
if extra_postargs:
|
if extra_postargs:
|
||||||
ld_args.extend (extra_postargs)
|
ld_args.extend (extra_postargs)
|
||||||
|
self.mkpath (os.path.dirname (output_filename))
|
||||||
self.spawn ([self.ld_exec] + ld_args)
|
self.spawn ([self.ld_exec] + ld_args)
|
||||||
else:
|
else:
|
||||||
self.announce ("skipping %s (up-to-date)" % output_filename)
|
self.announce ("skipping %s (up-to-date)" % output_filename)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue