Skip to content

Commit

Permalink
CMake: Reduce excess quoting
Browse files Browse the repository at this point in the history
cmake/cmake-builder.ps1 added quotes to arguments that contained spaces,
so that arguments printed correctly for progress output. This introduced
excess quotes that caused CMake (and likely other MS apps) confusion or
argument misinterpretation.

Instead of CMake seeing a single "Visual Studio 17 2022", CMake was
actually seeing "\"Visual Studio 17 2022\"".

This patch only adds the additional quotes when reporting progress or
emitting debug output. Otherwise, command line arguments are passed
unmolested.
  • Loading branch information
bscottm authored and pkoning2 committed Feb 23, 2024
1 parent a588496 commit c47e933
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmake/cmake-builder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,14 @@ foreach ($phase in $scriptPhases) {
Write-Host "** ${scriptName}: Configuring and generating"

$phaseCommand = ${cmakeCmd}
$argList = Quote-Args $generateArgs
$argList = $generateArgs
}

"build" {
Write-Host "** ${scriptName}: Building simulators."

$phaseCommand = ${cmakeCmd}
$argList = $(Quote-Args $buildArgs) + $(Quote-Args $buildSpecificArgs)
$argList = $buildArgs + $buildSpecificArgs
}

"test" {
Expand All @@ -529,7 +529,7 @@ foreach ($phase in $scriptPhases) {
}

$phaseCommand = ${ctestCmd}
$argList = Quote-Args $testArgs
$argList = $testArgs

$env:PATH = $modPath

Expand All @@ -556,13 +556,13 @@ foreach ($phase in $scriptPhases) {
}

$phaseCommand = ${cmakeCmd}
$argList = Quote-Args @( "--install", "${buildDir}", "--config", "${config}")
$argList = @( "--install", "${buildDir}", "--config", "${config}")
}
}

try {
Push-Location ${buildDir}
Write-Host "** ${phaseCommand} ${argList}"
Write-Host "** ${phaseCommand} $(Quote-Args ${argList})"
& $phaseCommand @arglist
if ($LastExitCode -gt 0) {
$printPhase = (Get-Culture).TextInfo.ToTitleCase($phase)
Expand Down

0 comments on commit c47e933

Please sign in to comment.