mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 02:31:29 +00:00
Add single file compile support for Windows in ninja wrappers
ninja.bat can't pass '^' for single file compile.
This change fixes ninja.bat to apply double quotas to args to preserve "^".
Note that ninja.bat still needs "^^" since single "^" is already removed as an escape character.
This is the same implementation with autoninja.{bat, py}.
Test: http://go/paste/6182226814304256
Bug: 1340825
Change-Id: I183c7890634a77471a617c4cc2b9c8c33bc8487d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4060603
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Junji Watanabe <jwata@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
This commit is contained in:
@@ -9,4 +9,4 @@ setlocal
|
||||
set PATH=%PATH%;%~dp0
|
||||
|
||||
:: Defer control.
|
||||
python3 "%~dp0\ninja.py" %*
|
||||
python3 "%~dp0\ninja.py" "%*"
|
||||
|
||||
8
ninja.py
8
ninja.py
@@ -67,6 +67,14 @@ def fallback(ninja_args):
|
||||
|
||||
|
||||
def main(args):
|
||||
# On Windows the ninja.bat script passes along the arguments enclosed in
|
||||
# double quotes. This prevents multiple levels of parsing of the special '^'
|
||||
# characters needed when compiling a single file. When this case is detected,
|
||||
# we need to split the argument. This means that arguments containing actual
|
||||
# spaces are not supported by ninja.bat, but that is not a real limitation.
|
||||
if (sys.platform.startswith('win') and len(args) == 2):
|
||||
args = args[:1] + args[1].split(' ')
|
||||
|
||||
# Get gclient root + src.
|
||||
primary_solution_path = gclient_paths.GetPrimarySolutionPath()
|
||||
gclient_root_path = gclient_paths.FindGclientRoot(os.getcwd())
|
||||
|
||||
Reference in New Issue
Block a user