File 1083-added-support-for-search-and-setup-WSL-for-amd64_-ar.patch of Package erlang

From e05e2de8a9ad8ff1e358341b8ea5763bc6238211 Mon Sep 17 00:00:00 2001
From: Cocoa <i@uwucocoa.moe>
Date: Mon, 23 Sep 2024 10:15:05 +0100
Subject: [PATCH] added support for search and setup WSL for `[amd64_]arm64`

---
 erts/etc/win32/wsl_tools/SetupWSLcross.bat | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/erts/etc/win32/wsl_tools/SetupWSLcross.bat b/erts/etc/win32/wsl_tools/SetupWSLcross.bat
index 0e8d9348c1..af33cfccf3 100644
--- a/erts/etc/win32/wsl_tools/SetupWSLcross.bat
+++ b/erts/etc/win32/wsl_tools/SetupWSLcross.bat
@@ -4,6 +4,9 @@ rem Usage: eval `cmd.exe /c SetupWSLcross.bat x64`
 
 IF "%~1"=="x86" GOTO search
 IF "%~1"=="x64" GOTO search
+IF "%~1"=="arm64" GOTO search
+IF "%~1"=="amd64_arm64" GOTO search
+IF "%~1"=="x64_arm64" GOTO search
 
 GOTO badarg
 
@@ -67,7 +70,12 @@ GOTO no_vcvars
 
 :continue
 
-FOR /F "delims==" %%F IN ('where cl.exe') DO SET _cl_exec_=%%F
+FOR /F "delims==" %%F IN ('where cl.exe') DO (
+   SET _cl_exec_=%%F
+   goto set_cl_path
+)
+
+:set_cl_path
 FOR %%F IN ("%_cl_exec_%") DO SET CL_PATH=%%~dpF
 
 FOR /F "delims==" %%F IN ('where rc.exe') DO SET _rc_exec_=%%F
@@ -87,7 +95,7 @@ wsl.exe echo "# Eval this file eval \`cmd.exe /c SetupWSLcross.bat\`"
 exit
 
 :badarg
-echo "Bad TARGET or not specified: %~1 expected x86 or x64"
+echo "Bad TARGET or not specified: %~1 expected x86, x64, arm64 or amd64_arm64(x64_arm64)"
 exit
 
 :no_vcvars
-- 
2.43.0

openSUSE Build Service is sponsored by