]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Build-System] Fix Visual Studio detection logic to use the latest installed when... 658/head
authorAndrey Volk <andywolk@gmail.com>
Mon, 25 May 2020 12:41:16 +0000 (16:41 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 25 May 2020 12:41:16 +0000 (16:41 +0400)
Freeswitch.2017.sln.bat
msbuild.cmd
w32/Setup/Sounds/build_sounds.cmd

index dd8c0df91631afb9d6f911e7999e36981e55988f..28f6a2ae210d226d9bb3e386bed4ae078d485297 100644 (file)
@@ -1,4 +1,4 @@
-@REM this script builds freeswitch using VS2017
+@REM this script builds freeswitch using the latest found Microsoft Visual Studio
 @REM only one platform/configuration will be built
 @REM runs (probably only) from the commandline
 @REM usage: Freeswitch.2017.sln  [[[.*]ebug] [[.*]elease] [[.*]64] [[.*]32]]
 @set procs=%NUMBER_OF_PROCESSORS%
 @set /a procs -= 1
 
-@REM check and set VS2017 environment
+@REM check and set Visual Studio environment
 CALL msbuild.cmd
 
 if exist %msbuild% (
-%msbuild% Freeswitch.2017.sln /m:%procs% /verbosity:normal /property:Configuration=%configuration% /property:Platform=%platform% /fl /flp:logfile=vs2017%platform%%configuration%.log;verbosity=normal
+%msbuild% Freeswitch.2017.sln /m:%procs% /verbosity:normal /property:Configuration=%configuration% /property:Platform=%platform% /fl /flp:logfile=vs%platform%%configuration%.log;verbosity=normal
 ) ELSE (
-    echo "echo ERROR: Cannot find msbuild. You need Visual Studio 2017 to compile this solution."
+    echo "echo ERROR: Cannot find msbuild. You need Microsoft Visual Studio to compile this solution."
 )
 @pause
 
index e165c5e55ba3ca6c5875bd8aff053df0693f22ae..33a8ebab6b427a667c3ddfc9ed82f22170e442fc 100644 (file)
@@ -1,5 +1,5 @@
-@REM check and set VS2017 environment\r
-rem VS2017U2 contains vswhere.exe\r
+@REM check and set Visual Studio environment\r
+rem There is vswhere.exe starting VS2017U2\r
 if "%VSWHERE%"=="" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"\r
 \r
 rem Use %ProgramFiles% in a 32-bit program prior to Windows 10)\r
@@ -7,7 +7,7 @@ If Not Exist "%VSWHERE%" set "VSWHERE=%ProgramFiles%\Microsoft Visual Studio\Ins
 \r
 If Not Exist "%VSWHERE%" (\r
     echo "WARNING: Can't find vswhere.exe. It is a part of VS 2017 version 15.2 or later. Trying known path..."\r
-    set "InstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"\r
+    set "InstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"\r
 ) ELSE (\r
     for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (\r
        set InstallDir=%%i\r
@@ -15,6 +15,6 @@ If Not Exist "%VSWHERE%" (
 )\r
 \r
 echo Install dir is "%InstallDir%"\r
-if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (\r
-    set msbuild="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"\r
+if exist "%InstallDir%\MSBuild\Current\Bin\MSBuild.exe" (\r
+    set msbuild="%InstallDir%\MSBuild\Current\Bin\MSBuild.exe"\r
 )\r
index 723a86abc7829911bd7ea49764ce49ef1229ccec..954ab56ce3691897dc4ff3089af56b96dc843e8f 100644 (file)
@@ -11,7 +11,7 @@ for /F "tokens=*" %%A in (%cd%\..\..\..\build\sounds_upgradecode.txt) do (
 )\r
 \r
 ) ELSE (\r
-    echo "echo ERROR: Cannot find msbuild. You need Visual Studio 2017 to compile this solution."\r
+    echo "echo ERROR: Cannot find msbuild. You need Microsoft Visual Studio to compile this solution."\r
     EXIT /B 1\r
 )\r
 \r
@@ -25,11 +25,11 @@ EXIT /B %ERRORLEVEL%
 :Build\r
 set SoundPrimaryName=%1\r
 set SoundQuality=8000\r
-cmd /C %msbuild% %solution% /p:SoundPrimaryName=%SoundPrimaryName% /p:SoundQuality=%SoundQuality% /p:Configuration=Release /p:Platform=x64 /t:Build /p:PlatformToolset=v141 /verbosity:normal /fl /flp:logfile=..\..\..\x64\sound_logs\sounds_%SoundPrimaryName%_%SoundQuality%.log;verbosity=normal\r
+cmd /C %msbuild% %solution% /p:SoundPrimaryName=%SoundPrimaryName% /p:SoundQuality=%SoundQuality% /p:Configuration=Release /p:Platform=x64 /t:Build /verbosity:normal /fl /flp:logfile=..\..\..\x64\sound_logs\sounds_%SoundPrimaryName%_%SoundQuality%.log;verbosity=normal\r
 set SoundQuality=16000\r
-cmd /C %msbuild% %solution% /p:SoundPrimaryName=%SoundPrimaryName% /p:SoundQuality=%SoundQuality% /p:Configuration=Release /p:Platform=x64 /t:Build /p:PlatformToolset=v141 /verbosity:normal /fl /flp:logfile=..\..\..\x64\sound_logs\sounds_%SoundPrimaryName%_%SoundQuality%.log;verbosity=normal\r
+cmd /C %msbuild% %solution% /p:SoundPrimaryName=%SoundPrimaryName% /p:SoundQuality=%SoundQuality% /p:Configuration=Release /p:Platform=x64 /t:Build /verbosity:normal /fl /flp:logfile=..\..\..\x64\sound_logs\sounds_%SoundPrimaryName%_%SoundQuality%.log;verbosity=normal\r
 set SoundQuality=32000\r
-cmd /C %msbuild% %solution% /p:SoundPrimaryName=%SoundPrimaryName% /p:SoundQuality=%SoundQuality% /p:Configuration=Release /p:Platform=x64 /t:Build /p:PlatformToolset=v141 /verbosity:normal /fl /flp:logfile=..\..\..\x64\sound_logs\sounds_%SoundPrimaryName%_%SoundQuality%.log;verbosity=normal\r
+cmd /C %msbuild% %solution% /p:SoundPrimaryName=%SoundPrimaryName% /p:SoundQuality=%SoundQuality% /p:Configuration=Release /p:Platform=x64 /t:Build /verbosity:normal /fl /flp:logfile=..\..\..\x64\sound_logs\sounds_%SoundPrimaryName%_%SoundQuality%.log;verbosity=normal\r
 set SoundQuality=48000\r
-cmd /C %msbuild% %solution% /p:SoundPrimaryName=%SoundPrimaryName% /p:SoundQuality=%SoundQuality% /p:Configuration=Release /p:Platform=x64 /t:Build /p:PlatformToolset=v141 /verbosity:normal /fl /flp:logfile=..\..\..\x64\sound_logs\sounds_%SoundPrimaryName%_%SoundQuality%.log;verbosity=normal\r
+cmd /C %msbuild% %solution% /p:SoundPrimaryName=%SoundPrimaryName% /p:SoundQuality=%SoundQuality% /p:Configuration=Release /p:Platform=x64 /t:Build /verbosity:normal /fl /flp:logfile=..\..\..\x64\sound_logs\sounds_%SoundPrimaryName%_%SoundQuality%.log;verbosity=normal\r
 EXIT /B 0\r