mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
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:
+7
-4
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user