summaryrefslogtreecommitdiff
path: root/setuptools/_distutils/_msvccompiler.py
diff options
context:
space:
mode:
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,