cmGlobalXCodeGenerator: Do not use legacy makefile escaping in shell commands

The `ConvertToMakefilePath` helper is meant only for paths in `.make`
files we generate for custom commands in the legacy build system.
This commit is contained in:
Brad King
2024-05-15 10:54:00 -04:00
parent d61fc2c52e
commit d929089687

View File

@@ -659,7 +659,8 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
bool isGenerateProject = isTopLevel || !generateTopLevelProjectOnly;
if (regenerate && isGenerateProject) {
this->CreateReRunCMakeFile(root, gens);
std::string file = ConvertToMakefilePath(this->CurrentReRunCMakeMakefile);
std::string file =
cmSystemTools::ConvertToOutputPath(this->CurrentReRunCMakeMakefile);
cmSystemTools::ReplaceString(file, "\\ ", " ");
cc = cm::make_unique<cmCustomCommand>();
cc->SetCommandLines(cmMakeSingleCommandLine({ "make", "-f", file }));
@@ -2205,11 +2206,10 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
}
std::string cdir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
cdir = ConvertToMakefilePath(cdir);
std::string makecmd =
cmStrCat("make -C ", cdir, " -f ",
ConvertToMakefilePath(cmStrCat(makefile, "$CONFIGURATION")),
" OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\") all");
cdir = cmSystemTools::ConvertToOutputPath(cdir);
std::string makecmd = cmStrCat(
"make -C ", cdir, " -f ", cmSystemTools::ConvertToOutputPath(makefile),
"$CONFIGURATION", " OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\") all");
buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
}