From 52e97e8d0a361f6d5de2ede664b5e18c2fe84e3c Mon Sep 17 00:00:00 2001
From: Andrey Volk <andywolk@gmail.com>
Date: Thu, 8 Dec 2022 03:02:42 +0300
Subject: [PATCH] [Build-System] Fix build on Windows 11: yasm tool compiled
 for x86 does not work on x64 system. Download yasm.exe 64bit instead.

---
 w32/yasm.props | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/w32/yasm.props b/w32/yasm.props
index 3ebcc6c84c..ffc4151426 100644
--- a/w32/yasm.props
+++ b/w32/yasm.props
@@ -5,6 +5,9 @@
   </ImportGroup>
   <PropertyGroup>
     <YasmPropsImported>true</YasmPropsImported>
+    <Is64yasm Condition="$([System.Environment]::Is64BitProcess)">true</Is64yasm>
+    <PackageToDownload Condition="'$(Is64yasm)' == 'true'">http://files.freeswitch.org/downloads/win64/yasm.exe</PackageToDownload>
+    <PackageToDownload Condition="'$(Is64yasm)' != 'true'">http://files.freeswitch.org/downloads/win32/yasm.exe</PackageToDownload>
   </PropertyGroup>
 
   <!--
@@ -28,8 +31,9 @@
    -->
 
   <Target Name="YasmDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="">
+      <Message Text="System is 64 bit." Condition="'$(Is64yasm)' == 'true'" Importance="High" />
       <DownloadPackageTask
-           package="http://files.freeswitch.org/downloads/win32/yasm.exe"
+           package="$(PackageToDownload)"
            expectfileordirectory="$(ProjectDir)\yasm.exe"
            outputfolder="$(ProjectDir)\"
            outputfilename=""