diff options
author | Bruce Forstall <brucefo@microsoft.com> | 2017-11-01 11:05:25 -0700 |
---|---|---|
committer | Bruce Forstall <brucefo@microsoft.com> | 2017-11-01 11:05:25 -0700 |
commit | c7745a9ed8d8b1c444afa7f3e6679de851afe55d (patch) | |
tree | 2734bdba2b52804e19ef41cf9dcb3f6d78fc328e /build.cmd | |
parent | 49d60b5e71bba4a7014ccf35f792906564d21dfc (diff) | |
download | coreclr-c7745a9ed8d8b1c444afa7f3e6679de851afe55d.tar.gz coreclr-c7745a9ed8d8b1c444afa7f3e6679de851afe55d.tar.bz2 coreclr-c7745a9ed8d8b1c444afa7f3e6679de851afe55d.zip |
Fix handling of `-priority=N` argument in build.cmd
This argument is intended to be passed through directly to msbuild,
but CMD doesn't handle `=` well, so using `-priority=N` with
`build all` didn't work, for instance.
Add special handling for the `-priority` argument to get around
this problem.
Diffstat (limited to 'build.cmd')
-rw-r--r-- | build.cmd | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -123,6 +123,12 @@ set __BuildPackages=1 set __BuildNativeCoreLib=1 set __RestoreOptData=1 +@REM CMD has a nasty habit of eating "=" on the argument list, so passing: +@REM -priority=1 +@REM appears to CMD parsing as "-priority 1". Handle -priority specially to avoid problems, +@REM and allow the "-priority=1" syntax. +set __Priority= + :Arg_Loop if "%1" == "" goto ArgsDone @@ -154,6 +160,8 @@ if /i "%1" == "debug" (set __BuildTypeDebug=1&set processedArgs=!p if /i "%1" == "checked" (set __BuildTypeChecked=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "release" (set __BuildTypeRelease=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "-priority" (set __Priority=%2&shift&set processedArgs=!processedArgs! %1=%2&shift&goto Arg_Loop) + REM All arguments after this point will be passed through directly to build.cmd on nested invocations REM using the "all" argument, and must be added to the __PassThroughArgs variable. if [!__PassThroughArgs!]==[] ( @@ -218,6 +226,16 @@ if [!processedArgs!]==[] ( :ArgsDone +@REM Special handling for -priority=N argument. +if defined __Priority ( + if defined __PassThroughArgs ( + set __PassThroughArgs=%__PassThroughArgs% -priority=%__Priority% + ) else ( + set __PassThroughArgs=-priority=%__Priority% + ) + set __UnprocessedBuildArgs=!__UnprocessedBuildArgs! -priority=%__Priority% +) + if %__PgoOptimize%==0 set __RestoreOptData=0 if defined __BuildAll goto BuildAll |