cmcldeps: Restore support for rc.exe path not fully GetShortPathName-d

In some cases `GetShortPathNameW` may not remove all spaces.  If that
happens with the path to `rc.exe`, cmcldeps needs to explicitly quote
the path in the command it runs.

This was exposed by commit 50a6e78a82 (cmSystemTools::RunSingleCommand():
Replace cmsysProcess with cmUVProcessChain, 2023-07-25, v3.28.0-rc1~138^2~4)
because the underlying process execution library no longer reconstructs the
command line without quotes around commands without spaces.

Fixes: #25355
stage/master/nightly/2023/10/24^2
Brad King 2023-10-23 16:46:18 -04:00
parent b99e99e1aa
commit 03080d18eb
1 changed files with 2 additions and 1 deletions

View File

@ -285,7 +285,8 @@ int main()
return exit_code;
// compile rc file with rc.exe
return process(srcfilename, "", objfile, prefix, binpath + " " + rest,
std::string rc = cmStrCat('"', binpath, '"');
return process(srcfilename, "", objfile, prefix, cmStrCat(rc, ' ', rest),
std::string(), true);
}