30 lines
1.2 KiB
Batchfile
30 lines
1.2 KiB
Batchfile
@echo off
|
|
setlocal
|
|
set "SLN=%~dp0TS660_DLL.sln"
|
|
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
|
set "MSBUILD="
|
|
|
|
for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do set "MSBUILD=%%i"
|
|
|
|
if not defined MSBUILD if exist "%ProgramFiles%\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe" set "MSBUILD=%ProgramFiles%\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\MSBuild.exe"
|
|
if not defined MSBUILD if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" set "MSBUILD=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
|
|
|
|
if not defined MSBUILD (
|
|
echo [ERROR] MSBuild not found. Install Visual Studio with "Desktop development with C++".
|
|
exit /b 1
|
|
)
|
|
|
|
echo Using MSBuild: %MSBUILD%
|
|
echo.
|
|
|
|
"%MSBUILD%" "%SLN%" /m /p:Configuration=Release /p:Platform=x64 /v:minimal
|
|
if errorlevel 1 exit /b 1
|
|
|
|
"%MSBUILD%" "%SLN%" /m /p:Configuration=Release /p:Platform=x86 /v:minimal
|
|
if errorlevel 1 exit /b 1
|
|
|
|
echo.
|
|
echo Built:
|
|
echo %~dp0bin\x64\Release\TS660_DLL.dll
|
|
echo %~dp0bin\Win32\Release\TS660_DLL.dll
|