diff --git a/llvm/utils/release/build_llvm_release.bat b/llvm/utils/release/build_llvm_release.bat --- a/llvm/utils/release/build_llvm_release.bat +++ b/llvm/utils/release/build_llvm_release.bat @@ -1,21 +1,51 @@ @echo off setlocal enabledelayedexpansion -if "%1"=="" goto usage goto begin :usage echo Script for building the LLVM installer on Windows, echo used for the releases at https://github.com/llvm/llvm-project/releases echo. -echo Usage: build_llvm_release.bat ^ +echo Usage: build_llvm_release.bat --revision ^ [--x86,--x64] echo. -echo Example: build_llvm_release.bat 14.0.4 +echo Options: +echo --revision: [required] revision to build +echo --help: display this help +echo --x86: build and test x86 variant +echo --x64: build and test x64 variant echo. +echo Note: At least one variant to build is required. +echo. +echo Example: build_llvm_release.bat --revision 15.0.0 --x64 exit /b 1 :begin +::============================================================================== +:: parse args +set revision= +set help= +set x86= +set x64= +call :parse_args %* + +if "%help%" NEQ "" goto usage + +if "%revision%" == "" ( + echo --revision option is required + echo ============================= + goto usage +) + +if "%x64%" == "" if "%x86%" == "" ( + echo nothing to build! + echo choose one or several variants from: --x86 --x64 + exit /b 1 +) + +::============================================================================== +:: check prerequisites REM Note: REM 7zip versions 21.x and higher will try to extract the symlinks in REM llvm's git archive, which requires running as administrator. @@ -50,8 +80,9 @@ REM REM For LLDB, SWIG version <= 3.0.8 needs to be used to work around REM https://github.com/swig/swig/issues/769 +REM - +:: Detect Visual Studio set vsdevcmd= set vs_2019_prefix=C:\Program Files (x86)\Microsoft Visual Studio\2019 :: try potential activated visual studio, then 2019, with different editions @@ -66,13 +97,15 @@ ) echo Using VS devcmd: %vsdevcmd% +::============================================================================== :: start echoing what we do @echo on + set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310-32 set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310 -set revision=llvmorg-%1 -set package_version=%1 +set revision=llvmorg-%revision% +set package_version=%revision% set build_dir=%cd%\llvm_package_%package_version% echo Revision: %revision% @@ -118,8 +151,8 @@ set OLDPATH=%PATH% REM Build the 32-bits and/or 64-bits binaries. -call :do_build_32 || exit /b 1 -call :do_build_64 || exit /b 1 +if "%x86%" == "true" call :do_build_32 || exit /b 1 +if "%x64%" == "true" call :do_build_64 || exit /b 1 exit /b 0 ::==============================================================================