[PATCH] D135255: Introduce options for Windows packaging script
Pierrick Bouvier via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 5 04:16:15 PDT 2022
pbo-linaro created this revision.
Herald added a subscriber: pengfei.
Herald added a project: All.
pbo-linaro requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Options:
--revision: [required] revision to build
--help: display this help
--x86: build and test x86 variant
--x64: build and test x64 variant
Note: At least one variant to build is required.
Example: build_llvm_release.bat --revision 15.0.0 --x64
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D135255
Files:
llvm/utils/release/build_llvm_release.bat
Index: llvm/utils/release/build_llvm_release.bat
===================================================================
--- llvm/utils/release/build_llvm_release.bat
+++ 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 ^<version^>
+echo Usage: build_llvm_release.bat --revision ^<version^> [--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
::==============================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135255.465339.patch
Type: text/x-patch
Size: 3011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221005/411a3cef/attachment.bin>
More information about the llvm-commits
mailing list