From 902b925763be71f387740a05501f0e8743a5a120 Mon Sep 17 00:00:00 2001 From: pal1000 Date: Thu, 31 Oct 2024 16:04:46 -0700 Subject: [PATCH] Make prompts CI capable 2/30 completed --- bin/modules/abiselect.cmd | 3 +-- bin/modules/prompt.cmd | 5 +++++ buildscript/modules/abi.cmd | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 bin/modules/prompt.cmd diff --git a/bin/modules/abiselect.cmd b/bin/modules/abiselect.cmd index ff8da182..c1c1b572 100644 --- a/bin/modules/abiselect.cmd +++ b/bin/modules/abiselect.cmd @@ -2,8 +2,7 @@ @if /I NOT %PROCESSOR_ARCHITECTURE%==X86 echo 1. x86 32-bit (Default) @if /I NOT %PROCESSOR_ARCHITECTURE%==X86 echo 2. x64 (x86 64-bit) @if /I %PROCESSOR_ARCHITECTURE%==ARM64 echo 3. ARM64 -@if /I NOT %PROCESSOR_ARCHITECTURE%==X86 set /p cpuchoice=Enter choice: -@if /I NOT %PROCESSOR_ARCHITECTURE%==X86 echo. +@if /I NOT %PROCESSOR_ARCHITECTURE%==X86 call "%~dp0prompt.cmd" cpuchoice "Enter choice:" @set invalidcpuchoice=0 @if /I %PROCESSOR_ARCHITECTURE%==X86 set cpuchoice=1 @if /I %PROCESSOR_ARCHITECTURE%==AMD64 IF NOT "%cpuchoice%"=="1" IF NOT "%cpuchoice%"=="2" set invalidcpuchoice=1 diff --git a/bin/modules/prompt.cmd b/bin/modules/prompt.cmd new file mode 100644 index 00000000..a76e1549 --- /dev/null +++ b/bin/modules/prompt.cmd @@ -0,0 +1,5 @@ +@IF NOT defined cimode set cimode=0 +@if %cimode% EQU 0 set /p %1=%~2 +@setlocal ENABLEDELAYEDEXPANSION +@if %cimode% EQU 1 IF NOT "!%1!"=="" echo %~2!%1! +@echo. diff --git a/buildscript/modules/abi.cmd b/buildscript/modules/abi.cmd index 3641f139..e2867c11 100644 --- a/buildscript/modules/abi.cmd +++ b/buildscript/modules/abi.cmd @@ -8,8 +8,7 @@ @rem Select MinGW shell based on ABI @set MSYSTEM=UCRT64 @set LMSYSTEM=ucrt64 -@if %abi%==x64 IF NOT %toolchain%==msvc set /p gccmsvcrt=Use MSVCRT compatible toolchain for MinGW GCC x64 build (y/n): -@if %abi%==x64 IF NOT %toolchain%==msvc echo. +@if %abi%==x64 IF NOT %toolchain%==msvc call "%devroot%\%projectname%\bin\modules\prompt.cmd" gccmsvcrt "Use MSVCRT compatible toolchain for MinGW GCC x64 build (y/n):" @if /I "%gccmsvcrt%"=="y" set MSYSTEM=MINGW64 @IF /I "%gccmsvcrt%"=="y" set LMSYSTEM=mingw64 @IF %abi%==x86 set MSYSTEM=MINGW32