Skip to content

Commit

Permalink
Merge pull request #93589 from mhilbrunner/fix-windows-vs-arch-detection
Browse files Browse the repository at this point in the history
Windows: Fix arch detection via `VCTOOLSINSTALLDIR` if not first in `PATH`
  • Loading branch information
akien-mga committed Jun 28, 2024
2 parents 6f8b90e + 63911b9 commit 3cefe89
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions platform/windows/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ def detect_build_env_arch():
if os.getenv("VCTOOLSINSTALLDIR"):
host_path_index = os.getenv("PATH").upper().find(os.getenv("VCTOOLSINSTALLDIR").upper() + "BIN\\HOST")
if host_path_index > -1:
first_path_arch = os.getenv("PATH").split(";")[0].rsplit("\\", 1)[-1].lower()
return msvc_target_aliases[first_path_arch]
first_path_arch = os.getenv("PATH")[host_path_index:].split(";")[0].rsplit("\\", 1)[-1].lower()
if first_path_arch in msvc_target_aliases.keys():
return msvc_target_aliases[first_path_arch]

msys_target_aliases = {
"mingw32": "x86_32",
Expand Down

0 comments on commit 3cefe89

Please sign in to comment.