From 63911b994c5ba7963d6673e59e7cd77efbb15147 Mon Sep 17 00:00:00 2001 From: Max Hilbrunner Date: Tue, 25 Jun 2024 13:31:46 +0200 Subject: [PATCH] Windows: Fix arch detection via VCTOOLSINSTALLDIR --- platform/windows/detect.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 0ad84240e4c..8e1abba3bbd 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -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",