Created
March 17, 2021 07:54
-
-
Save t-mat/2620171257cca0136c83b017a283ac40 to your computer and use it in GitHub Desktop.
Build RunCPM with VC++2019
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rem Build RunCPM for Windows x64 Desktop, VC++2019 | |
@setlocal enabledelayedexpansion | |
@echo off | |
pushd . | |
set /a errorno=1 | |
git --version || goto :ERROR | |
rem | |
rem Set Visual C++ environment for Windows, desktop, x64. | |
rem | |
rem https://github.com/Microsoft/vswhere | |
rem https://github.com/microsoft/vswhere/wiki/Find-VC#batch | |
rem | |
set "vswhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" | |
if not exist "%vswhere%" ( | |
echo Can't find "vswhere.exe". Please install the latest version of Visual Studio. | |
goto :ERROR | |
) | |
set "InstallDir=" | |
for /f "usebackq tokens=*" %%i in (`"%vswhere%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( | |
set "InstallDir=%%i" | |
) | |
if "%InstallDir%" == "" ( | |
echo Can't find Visual C++. Please install the latest version of Visual C++. | |
goto :ERROR | |
) | |
rem Set -no_logo | |
rem For details, see %InstallDir%\Common7\Tools\vsdevcmd\core\parse_cmd.bat | |
set __VSCMD_ARG_NO_LOGO=1 | |
echo call "%InstallDir%\VC\Auxiliary\Build\vcvars64.bat" | |
call "%InstallDir%\VC\Auxiliary\Build\vcvars64.bat" || goto :ERROR | |
rem | |
rem Build RunCPM | |
rem | |
if not exist "RunCPM" ( | |
git clone --depth 1 https://github.com/MockbaTheBorg/RunCPM.git || goto :ERROR | |
) | |
pushd RunCPM | |
msbuild RunCPM.sln /nologo /v:minimal /m /p:Configuration=Release /p:Platform=x64 /t:Clean,Build || goto :ERROR | |
popd | |
if not exist artifacts ( md artifacts ) | |
if not exist artifacts\A\0 ( md artifacts\A\0 ) | |
copy RunCPM\x64\Release\RunCPM.exe .\artifacts | |
tar -xf RunCPM\DISK\A.ZIP -C .\artifacts\A\0 | |
echo All artifacts are in %CD%\artifacts | |
echo Run the following command to execute RunCPM | |
echo start "" /D "%CD%\artifacts" "%CD%\artifacts\RunCPM.exe" | |
echo Build Status - SUCCEEDED | |
set /a errorno=0 | |
goto :END | |
:ERROR | |
echo Abort by error. | |
echo Build Status - ERROR | |
:END | |
popd | |
exit /B %errorno% |
Author
t-mat
commented
Mar 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment