From d3fcf39c76ca506608996007fc050731a64f3a77 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 21 Nov 2025 11:49:35 +0500 Subject: [PATCH] Windows build scripts - `ECHO_ON` env variable for debugging --- win/build-all.cmd | 2 +- win/build-deps.cmd | 2 +- win/build-ifcopenshell.bat | 2 +- win/build-type-cfg.cmd | 2 +- win/install-ifcopenshell.bat | 2 +- win/run-cmake.bat | 2 +- win/set-python-to-path.bat | 2 +- win/utils/cecho.cmd | 2 ++ win/vs-cfg.cmd | 2 +- 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/win/build-all.cmd b/win/build-all.cmd index 4f29f0edd3..28ff229907 100644 --- a/win/build-all.cmd +++ b/win/build-all.cmd @@ -23,7 +23,7 @@ :: Usage example for doing an optimized vs2015-x64 build with debug information and using IFC 4: :: > build-all.cmd vs2015-x64 RelWithDebInfo -DUSE_IFC4=1 -DENABLE_BUILD_OPTIMIZATIONS=1 -@echo off +@if not defined ECHO_ON ( echo off ) setlocal EnableDelayedExpansion diff --git a/win/build-deps.cmd b/win/build-deps.cmd index 3a5555bebb..e8fc0924d7 100644 --- a/win/build-deps.cmd +++ b/win/build-deps.cmd @@ -24,7 +24,7 @@ :: Example usage (all arguments are optional): :: build-deps.cmd vs2022-x64 RelWithDebInfo Build -@echo off +@if not defined ECHO_ON ( echo off ) echo. for %%Q in ("%~dp0\.") DO set "batpath=%%~fQ" diff --git a/win/build-ifcopenshell.bat b/win/build-ifcopenshell.bat index 7f8233cb54..24d43e3a1a 100755 --- a/win/build-ifcopenshell.bat +++ b/win/build-ifcopenshell.bat @@ -21,7 +21,7 @@ :: a deduced generator will be used for %1 and BUILD_CFG_DEFAULT for %2 (both set in vs-cfg.cmd) :: Possible extra parameters are passed for the MSBuild call. -@echo off +@if not defined ECHO_ON ( echo off ) set PROJECT_NAME=IfcOpenShell echo. diff --git a/win/build-type-cfg.cmd b/win/build-type-cfg.cmd index acb75d64ad..773c3f300b 100644 --- a/win/build-type-cfg.cmd +++ b/win/build-type-cfg.cmd @@ -20,7 +20,7 @@ :: This script initializes various CMake build configuration type related variables. :: This batch file expects CMake build configuration type as %1. -@echo off +@if not defined ECHO_ON ( echo off ) :: Set up variables depending on the used build configuration type. set BUILD_CFG=%1 diff --git a/win/install-ifcopenshell.bat b/win/install-ifcopenshell.bat index 592ec85b89..77b89b2f4c 100755 --- a/win/install-ifcopenshell.bat +++ b/win/install-ifcopenshell.bat @@ -21,7 +21,7 @@ :: a deduced generator will be used for %1 and BUILD_CFG_DEFAULT for %2 (both set in vs-cfg.cmd) :: Possible extra parameters are passed for the MSBuild call. -@echo off +@if not defined ECHO_ON ( echo off ) set PROJECT_NAME=IfcOpenShell echo. diff --git a/win/run-cmake.bat b/win/run-cmake.bat index 68863fc847..7126cf9219 100755 --- a/win/run-cmake.bat +++ b/win/run-cmake.bat @@ -17,7 +17,7 @@ :: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -@echo off +@if not defined ECHO_ON ( echo off ) echo. set PROJECT_NAME=IfcOpenShell diff --git a/win/set-python-to-path.bat b/win/set-python-to-path.bat index 5c7ebe00bc..08e3f7f5e3 100755 --- a/win/set-python-to-path.bat +++ b/win/set-python-to-path.bat @@ -19,7 +19,7 @@ :: Pass x86 or x64 as %1, if not specified x64 assumed. -@echo off +@if not defined ECHO_ON ( echo off ) set TARGET_ARCH=%1 if "%TARGET_ARCH%"=="" set TARGET_ARCH=x64 if not exist "%~dp0BuildDepsCache-%TARGET_ARCH%.txt". ( diff --git a/win/utils/cecho.cmd b/win/utils/cecho.cmd index f0eb1b3749..97361c881a 100644 --- a/win/utils/cecho.cmd +++ b/win/utils/cecho.cmd @@ -1,3 +1,4 @@ +:: Don't check for `ECHO_ON` or it will get too verbose without any benefit. @echo off setlocal ENABLEDELAYEDEXPANSION @@ -38,5 +39,6 @@ if defined BGC ( echo|set /p="!STYLE!!TEXT!!ESC![0m" echo. +if defined ECHO_ON ( echo on ) endlocal exit /b 0 diff --git a/win/vs-cfg.cmd b/win/vs-cfg.cmd index b086d6db5a..794291792b 100644 --- a/win/vs-cfg.cmd +++ b/win/vs-cfg.cmd @@ -36,7 +36,7 @@ :: :: NOTE: The delayed environment variable expansion needs to be enabled before calling this. -@echo off +@if not defined ECHO_ON ( echo off ) set GENERATOR=%1