summaryrefslogtreecommitdiffstats
path: root/Source/cmcldeps.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-10-23 20:46:18 (GMT)
committerBrad King <brad.king@kitware.com>2023-10-23 21:03:01 (GMT)
commit03080d18eb20548f573bf5ff5a66c8eb38a6ebca (patch)
tree87ee1f42b80aaf9143acaa0f44d53d0888a80747 /Source/cmcldeps.cxx
parentb99e99e1aa3125eca923221c976b3bc6ad8d6b09 (diff)
downloadCMake-03080d18eb20548f573bf5ff5a66c8eb38a6ebca.zip
CMake-03080d18eb20548f573bf5ff5a66c8eb38a6ebca.tar.gz
CMake-03080d18eb20548f573bf5ff5a66c8eb38a6ebca.tar.bz2
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
Diffstat (limited to 'Source/cmcldeps.cxx')
-rw-r--r--Source/cmcldeps.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index 72805d3..5310166 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx
@@ -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);
}