Files
systeminformer/build/build_init.cmd
dmex c107a17d0d Improve clang-lld and build tooling
Add clang-lld CMake toolchains for x86/x64/ARM64 and update the shared CMake/MSVC logic to handle lld-link limitations, optional clang speculative load hardening, host-architecture tool selection, and user-mode defines that match Common.User.props.

Refresh the Windows build scripts to use the newer MSBuild invocation flags, support CI/binlog/low-priority options, allow build target overrides, switch CustomBuildTool publishing to dotnet msbuild, reorder init so tools build before third-party deps, and let build_zsign sign a single file or an entire output tree.
2026-09-24 14:32:21 +10:00

56 lines
2.1 KiB
Batchfile

@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0\.."
REM -----------------------------------------------------------------------------
REM Script: build_init.cmd
REM Description: Bootstraps third-party components and the local build tools.
REM -----------------------------------------------------------------------------
REM Initialize script state and INIT-mode pause suppression.
set "ExitCode=0"
set "IsCI=false"
set "SuppressPause=false"
if /i "%~1"=="INIT" set "SuppressPause=true"
REM Run the main script flow and capture the final exit code.
call :DetectCi
call :Main
if errorlevel 1 set "ExitCode=%errorlevel%"
:end
REM Pause only for interactive, non-CI, non-nested invocations before returning.
if /i "%SuppressPause%"=="false" if /i "%IsCI%"=="false" call :PauseIfInteractive
endlocal & exit /b %ExitCode%
REM -----------------------------------------------------------------------------
REM Function: Main
REM Description: Builds third-party dependencies first, then build tools.
REM -----------------------------------------------------------------------------
:Main
call "%~dp0build_tools.cmd" INIT
if errorlevel 1 exit /b %errorlevel%
call "%~dp0build_thirdparty.cmd" INIT
if errorlevel 1 exit /b %errorlevel%
exit /b 0
REM -----------------------------------------------------------------------------
REM Function: DetectCi
REM Description: Detects whether the script is running under CI.
REM -----------------------------------------------------------------------------
:DetectCi
if /i "%GITHUB_ACTIONS%"=="true" set "IsCI=true"
if /i "%TF_BUILD%"=="true" set "IsCI=true"
exit /b 0
REM -----------------------------------------------------------------------------
REM Function: PauseIfInteractive
REM Description: Pauses only when stdin is attached to an interactive console.
REM -----------------------------------------------------------------------------
:PauseIfInteractive
set "STDIN_REDIRECTED=False"
for /f %%i in ('powershell -NoProfile -Command "[Console]::IsInputRedirected"') do set "STDIN_REDIRECTED=%%i"
if /i not "%STDIN_REDIRECTED%"=="True" pause
exit /b 0