Skip to content

Commit

Permalink
Fix cross-platform compilation using `distutils._msvccompiler.MSVCCom…
Browse files Browse the repository at this point in the history
…piler`.

Actually use the `plat_name` param in `MSVCCompiler.initialize`.

Selective cherry-pick of pypa/distutils@a0339c1.

Closes #4648.
  • Loading branch information
Avasam authored and jaraco committed Sep 15, 2024
1 parent 56fc311 commit 809a9a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions newsfragments/4648.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix cross-platform compilation using ``distutils._msvccompiler.MSVCCompiler`` -- by :user:`saschanaz` and :user:`Avasam`
2 changes: 1 addition & 1 deletion setuptools/_distutils/_msvccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def initialize(self, plat_name=None):
f"--plat-name must be one of {tuple(_vcvars_names)}"
)

plat_spec = _get_vcvars_spec(get_host_platform(), get_platform())
plat_spec = _get_vcvars_spec(get_host_platform(), plat_name)

vc_env = _get_vc_env(plat_spec)
if not vc_env:
Expand Down

0 comments on commit 809a9a7

Please sign in to comment.