Skip to content

Commit

Permalink
Wrapper helper script for windows apps to be able to log the compile/…
Browse files Browse the repository at this point in the history
…etc calls, also supports no arg required by symlinking and use the batch file call name
  • Loading branch information
mitchcapper committed Jul 26, 2023
1 parent 5a402d1 commit 246ca45
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions windows_command_wrapper.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@ECHO OFF
set CMD=%~n1%
set GNU_BUILD_WRAPPER_DEBUG=1
IF "%~n0%"=="windows_command_wrapper" GOTO notsym

set CMD=%~n0%.exe
ECHO "ROBO: %~n0% " 1>&2

IF "%GNU_BUILD_WRAPPER_DEBUG%"=="1" ECHO "GNU %CMD% CMD: %CMD% %*" 1>&2
IF "%CMD%" == "link.exe" set CMD="%VCToolsInstallDir%bin/HostX64/x64/link.exe"

if not defined GNU_BUILD_CMD_FILE GOTO endif1
>>"%GNU_BUILD_CMD_FILE%" echo %CMD% %*
:endif1
%CMD% %*
Exit /B %ERRORLEVEL%
goto:eof

:notsym
IF "%GNU_BUILD_WRAPPER_DEBUG%"=="1" ECHO "GNU2 %CMD% CMD: %*" 1>&2

if not defined GNU_BUILD_CMD_FILE GOTO endif2
>>"%GNU_BUILD_CMD_FILE%" echo %*
:endif2
%*
rem Exit 1
Exit /B %ERRORLEVEL%
1 change: 1 addition & 0 deletions wraps/cl.bat
1 change: 1 addition & 0 deletions wraps/lib.bat
1 change: 1 addition & 0 deletions wraps/link.bat

0 comments on commit 246ca45

Please sign in to comment.