Fix x86/x64 build

This commit is contained in:
Adam Demasi 2023-07-27 03:11:59 +09:30
parent 57f6712987
commit 63f5bafd2e
No known key found for this signature in database
GPG key ID: 5D3B26B3D58C7D91

View file

@ -17,20 +17,31 @@ if not exist "%ProgramFiles32%\NSIS\Bin\makensis.exe" (
if exist "%ProgramFiles32%\Microsoft Visual Studio\Installer\vswhere.exe" (
:: Get modern Visual Studio install path
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set VSPath=%%i
call "!VSPath!\VC\Auxiliary\Build\vcvarsall.bat" x86
set "vcvarsall=!VSPath!\VC\Auxiliary\Build\vcvarsall.bat"
if "%errorlevel%" neq "0" exit /b %errorlevel%
) else if exist "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" (
:: Visual Studio 2010
call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
set "vcvarsall=%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
if "%errorlevel%" neq "0" exit /b %errorlevel%
) else (
echo Visual Studio not found. Refer to README.md. >&2
exit /b 1
)
:: Clean
call "%vcvarsall%" x86
msbuild LegacyUpdate.sln /m /p:Configuration=Release /p:Platform=Win32 /t:clean
if "%errorlevel%" neq "0" exit /b %errorlevel%
msbuild LegacyUpdate.sln /m /p:Configuration=Release /p:Platform=x64 /t:clean
if "%errorlevel%" neq "0" exit /b %errorlevel%
:: Build DLL
msbuild LegacyUpdate.sln /m /p:Configuration=Release /p:Platform=Win32 %*
if "%errorlevel%" neq "0" exit /b %errorlevel%
call "%vcvarsall%" x64
msbuild LegacyUpdate.sln /m /p:Configuration=Release /p:Platform=x64 %*
if "%errorlevel%" neq "0" exit /b %errorlevel%
:: Build NSIS
makensis setup\setup.nsi
if "%errorlevel%" neq "0" exit /b %errorlevel%