windows-build-clang.bat 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set top=%cd%
  4. if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
  5. echo ERROR: cannot find vswhere.exe
  6. pause
  7. exit
  8. )
  9. for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property catalog_productLineVersion`) do (
  10. set version=%%i
  11. )
  12. if %version%==2022 (
  13. echo Found VS2022.
  14. ) else (
  15. echo ERROR: could not find Visual Studio 2022.
  16. pause
  17. exit
  18. )
  19. for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do (
  20. set msbuild=%%i
  21. )
  22. if not exist "%msbuild%" (
  23. echo ERROR: cannot find msbuild.exe
  24. pause
  25. exit
  26. )
  27. cd scripts
  28. call .\windows-prebuild.bat %version%-clang
  29. cd %top%
  30. "%msbuild%" /t:Build /m /p:PreferredToolArchitecture=x64 /p:Configuration=Release;Platform=x64 %CD%\build-vs%version%-clang\CoolVLViewer.sln
  31. echo.
  32. echo Please, be aware that VS%version%-clang viewer builds are currently unsupported.
  33. echo.
  34. echo Compilation finished (and hopefully successful). Press a key to exit.
  35. pause