IAR: Fix ichecks invocation on Windows when not using short paths

In commit c7d2a17253 (IAR: Add support for C-STAT static analysis,
2025-04-08, v4.1.0-rc1~385^2) we accidentally assumed the path to
`ichecks` never has a space.  It worked because we always constructed
the path from a Windows "short path" to the compiler tool.  Avoid
relying on that.
This commit is contained in:
Brad King
2026-02-24 10:40:05 -05:00
parent 3d51b027eb
commit 728b8b34c2
+7 -4
View File
@@ -632,13 +632,16 @@ int HandleIcstat(std::string const& runCmd, std::string const& sourceFile,
// Create the default manifest ruleset file when not found
if (!cmSystemTools::FileExists("cstat_sel_checks.txt")) {
std::string ichecks_cmd = cmSystemTools::GetFilenamePath(orig_cmd[0]);
ichecks_cmd = cmStrCat(ichecks_cmd, "/ichecks --default stdchecks");
std::vector<std::string> ichecks_cmd;
ichecks_cmd.emplace_back(
cmStrCat(cmSystemTools::GetFilenamePath(orig_cmd[0]), "/ichecks"));
ichecks_cmd.emplace_back("--default");
ichecks_cmd.emplace_back("stdchecks");
if (!cmSystemTools::RunSingleCommand(ichecks_cmd, &stdOut, &stdErr, &ret,
nullptr,
cmSystemTools::OUTPUT_NONE)) {
std::cerr << "Error generating default manifest file '" << ichecks_cmd
<< "'. " << stdOut << '\n';
std::cerr << "Error generating default manifest file '" << ichecks_cmd[0]
<< "': " << stdOut << '\n';
return 1;
}
}