summaryrefslogtreecommitdiff
path: root/setuptools/_distutils/_msvccompiler.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-08-21 15:52:13 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-08-21 15:52:13 -0400
commit7ceffdafd2bdcabd09245c30037ac11946f64593 (patch)
tree9658187d8cde3a856672bd301d3a24d32fd5410e /setuptools/_distutils/_msvccompiler.py
parentd486278ab44a3081a72b2eae29ce6321f5d762b0 (diff)
parent22b9bcf2e2d2a66f7dc96661312972e2f6bd9e01 (diff)
downloadpython-setuptools-git-7ceffdafd2bdcabd09245c30037ac11946f64593.tar.gz
Merge https://github.com/pypa/distutils into distutils-22b9bcf
Diffstat (limited to 'setuptools/_distutils/_msvccompiler.py')
-rw-r--r--setuptools/_distutils/_msvccompiler.py30
1 files changed, 4 insertions, 26 deletions
diff --git a/setuptools/_distutils/_msvccompiler.py b/setuptools/_distutils/_msvccompiler.py
index ade80056..729c2dd5 100644
--- a/setuptools/_distutils/_msvccompiler.py
+++ b/setuptools/_distutils/_msvccompiler.py
@@ -318,38 +318,16 @@ class MSVCCompiler(CCompiler):
# -- Worker methods ------------------------------------------------
- def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
- ext_map = {
- **{ext: self.obj_extension for ext in self.src_extensions},
+ @property
+ def out_extensions(self):
+ return {
+ **super().out_extensions,
**{
ext: self.res_extension
for ext in self._rc_extensions + self._mc_extensions
},
}
- output_dir = output_dir or ''
-
- def make_out_path(p):
- base, ext = os.path.splitext(p)
- if strip_dir:
- base = os.path.basename(base)
- else:
- _, base = os.path.splitdrive(base)
- if base.startswith((os.path.sep, os.path.altsep)):
- base = base[1:]
- try:
- # XXX: This may produce absurdly long paths. We should check
- # the length of the result and trim base until we fit within
- # 260 characters.
- return os.path.join(output_dir, base + ext_map[ext])
- except LookupError:
- # Better to raise an exception instead of silently continuing
- # and later complain about sources and targets having
- # different lengths
- raise CompileError(f"Don't know how to compile {p}")
-
- return list(map(make_out_path, source_filenames))
-
def compile( # noqa: C901
self,
sources,