forked from Mirrors/freeswitch
[Build-System] Fix Visual Studio detection logic to use the latest installed when building FreeSWITCH or sound packages.
This commit is contained in:
parent
ef70d4d59b
commit
7490fba772
|
@ -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]]
|
||||
|
@ -47,13 +47,13 @@
|
|||
@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
|
||||
|
||||
|
|
10
msbuild.cmd
10
msbuild.cmd
|
@ -1,5 +1,5 @@
|
|||
@REM check and set VS2017 environment
|
||||
rem VS2017U2 contains vswhere.exe
|
||||
@REM check and set Visual Studio environment
|
||||
rem There is vswhere.exe starting VS2017U2
|
||||
if "%VSWHERE%"=="" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
|
||||
rem Use %ProgramFiles% in a 32-bit program prior to Windows 10)
|
||||
|
@ -7,7 +7,7 @@ If Not Exist "%VSWHERE%" set "VSWHERE=%ProgramFiles%\Microsoft Visual Studio\Ins
|
|||
|
||||
If Not Exist "%VSWHERE%" (
|
||||
echo "WARNING: Can't find vswhere.exe. It is a part of VS 2017 version 15.2 or later. Trying known path..."
|
||||
set "InstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
|
||||
set "InstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
|
||||
) ELSE (
|
||||
for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
|
||||
set InstallDir=%%i
|
||||
|
@ -15,6 +15,6 @@ If Not Exist "%VSWHERE%" (
|
|||
)
|
||||
|
||||
echo Install dir is "%InstallDir%"
|
||||
if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
|
||||
set msbuild="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
|
||||
if exist "%InstallDir%\MSBuild\Current\Bin\MSBuild.exe" (
|
||||
set msbuild="%InstallDir%\MSBuild\Current\Bin\MSBuild.exe"
|
||||
)
|
||||
|
|
|
@ -11,7 +11,7 @@ for /F "tokens=*" %%A in (%cd%\..\..\..\build\sounds_upgradecode.txt) do (
|
|||
)
|
||||
|
||||
) 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."
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
|
@ -25,11 +25,11 @@ EXIT /B %ERRORLEVEL%
|
|||
:Build
|
||||
set SoundPrimaryName=%1
|
||||
set SoundQuality=8000
|
||||
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
|
||||
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
|
||||
set SoundQuality=16000
|
||||
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
|
||||
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
|
||||
set SoundQuality=32000
|
||||
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
|
||||
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
|
||||
set SoundQuality=48000
|
||||
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
|
||||
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
|
||||
EXIT /B 0
|
||||
|
|
Loading…
Reference in New Issue