Commit ee3946be authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Fix autoninja.bat to not swallow ^^ sequences

Ninja uses the '^' character to indicate that ninja should build the
targets that are generated from the specified file, rather than
building the specified file. On Windows '^^' is needed because '^' is
the line continuation character. However autoninja.bat complicates
things because the multiple levels of batch files successfully swallow
pairs of '^' characters.

By adding quotes around %* in autoninja.bat it becomes possible to
invoke autoninja.bat normally. That is, this works:

    autoninja -C out\debug_component ..\..\base\win\enum_variant.cc^^

It can be convenient to have a ninja.bat file which starts goma and lets
users keep typing the same build commands. However even with this fix
the previously recommended ninja.bat file requires four '^' characters.
If that is too much then the new recommended ninja.bat is to copy
autoninja.bat and modify as needed, perhaps like this:

    @echo off
    call python c:\goma\goma-win64\goma_ctl.py ensure_start >nul
    FOR /f "usebackq tokens=*" %%a in (`python c:\src\depot_tools\autoninja.py "%*"`) do echo %%a & %%a

BUG=758725

Change-Id: I648cf42675af2f946be7aa4033956b015d953829
Reviewed-on: https://chromium-review.googlesource.com/651826Reviewed-by: 's avatarSébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
parent 4dd9682b
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
REM Execute whatever is printed by autoninja.py. REM Execute whatever is printed by autoninja.py.
REM Also print it to reassure that the right settings are being used. REM Also print it to reassure that the right settings are being used.
FOR /f "usebackq tokens=*" %%a in (`python %~dp0autoninja.py %*`) do echo %%a & %%a FOR /f "usebackq tokens=*" %%a in (`python %~dp0autoninja.py "%*"`) do echo %%a & %%a
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment