Convert: Replace uses of Convert(NONE)

These are equivalent to ConvertToOutputFormat.
This commit is contained in:
Stephen Kelly 2016-08-27 13:44:55 +02:00
parent 998d9ee967
commit ac46384171
9 changed files with 49 additions and 54 deletions

View File

@ -74,8 +74,7 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags(
for (std::vector<std::string>::const_iterator idi = includes.begin(); for (std::vector<std::string>::const_iterator idi = includes.begin();
idi != includes.end(); ++idi) { idi != includes.end(); ++idi) {
std::string flg = modpath_flag; std::string flg = modpath_flag;
flg += flg += this->ConvertToOutputFormat(*idi, cmOutputConverter::SHELL);
this->Convert(*idi, cmOutputConverter::NONE, cmOutputConverter::SHELL);
this->AppendFlags(flags, flg); this->AppendFlags(flags, flg);
} }
} }

View File

@ -1393,7 +1393,7 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib,
sp += lib.substr(pos); sp += lib.substr(pos);
// Convert to an output path. // Convert to an output path.
return this->Convert(sp.c_str(), NONE, format); return this->ConvertToOutputFormat(sp.c_str(), format);
} }
} }
} }
@ -1489,7 +1489,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
for (std::vector<std::string>::const_iterator fdi = fwDirs.begin(); for (std::vector<std::string>::const_iterator fdi = fwDirs.begin();
fdi != fwDirs.end(); ++fdi) { fdi != fwDirs.end(); ++fdi) {
frameworkPath += fwSearchFlag; frameworkPath += fwSearchFlag;
frameworkPath += this->Convert(*fdi, NONE, shellFormat); frameworkPath += this->ConvertToOutputFormat(*fdi, shellFormat);
frameworkPath += " "; frameworkPath += " ";
} }
} }
@ -1535,7 +1535,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
for (std::vector<std::string>::iterator ri = runtimeDirs.begin(); for (std::vector<std::string>::iterator ri = runtimeDirs.begin();
ri != runtimeDirs.end(); ++ri) { ri != runtimeDirs.end(); ++ri) {
rpath += cli.GetRuntimeFlag(); rpath += cli.GetRuntimeFlag();
rpath += this->Convert(*ri, NONE, shellFormat); rpath += this->ConvertToOutputFormat(*ri, shellFormat);
rpath += " "; rpath += " ";
} }
fout << rpath; fout << rpath;
@ -1605,7 +1605,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
flags += " "; flags += " ";
flags += sysrootFlag; flags += sysrootFlag;
flags += " "; flags += " ";
flags += this->Convert(sysroot, NONE, SHELL); flags += this->ConvertToOutputFormat(sysroot, SHELL);
} }
if (deploymentTargetFlag && *deploymentTargetFlag && deploymentTarget && if (deploymentTargetFlag && *deploymentTargetFlag && deploymentTarget &&

View File

@ -490,8 +490,8 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT, output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
cmOutputConverter::SHELL); cmOutputConverter::SHELL);
} else { } else {
output = this->Convert(outputs[0], cmOutputConverter::NONE, output =
cmOutputConverter::SHELL); this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
} }
} }
vars.Output = output.c_str(); vars.Output = output.c_str();

View File

@ -602,8 +602,7 @@ std::string cmLocalUnixMakefileGenerator3::MaybeConvertWatcomShellCommand(
// lines with shell redirection operators. // lines with shell redirection operators.
std::string scmd; std::string scmd;
if (cmSystemTools::GetShortPath(cmd, scmd)) { if (cmSystemTools::GetShortPath(cmd, scmd)) {
return this->Convert(scmd, cmOutputConverter::NONE, return this->ConvertToOutputFormat(scmd, cmOutputConverter::SHELL);
cmOutputConverter::SHELL);
} }
} }
return std::string(); return std::string();
@ -790,8 +789,8 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom(
std::string runRule = std::string runRule =
"$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"; "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
runRule += " --check-build-system "; runRule += " --check-build-system ";
runRule += this->Convert(cmakefileName, cmOutputConverter::NONE, runRule +=
cmOutputConverter::SHELL); this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL);
runRule += " 0"; runRule += " 0";
std::vector<std::string> no_depends; std::vector<std::string> no_depends;
@ -995,8 +994,8 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
cmOutputConverter::SHELL); cmOutputConverter::SHELL);
} else { } else {
output = this->Convert(outputs[0], cmOutputConverter::NONE, output = this->ConvertToOutputFormat(outputs[0],
cmOutputConverter::SHELL); cmOutputConverter::SHELL);
} }
} }
vars.Output = output.c_str(); vars.Output = output.c_str();
@ -1009,8 +1008,8 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
std::string shellCommand = this->MaybeConvertWatcomShellCommand(cmd); std::string shellCommand = this->MaybeConvertWatcomShellCommand(cmd);
if (shellCommand.empty()) { if (shellCommand.empty()) {
shellCommand = this->Convert(cmd, cmOutputConverter::NONE, shellCommand =
cmOutputConverter::SHELL); this->ConvertToOutputFormat(cmd, cmOutputConverter::SHELL);
} }
cmd = launcher + shellCommand; cmd = launcher + shellCommand;
@ -1681,8 +1680,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
std::string runRule = std::string runRule =
"$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"; "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
runRule += " --check-build-system "; runRule += " --check-build-system ";
runRule += this->Convert(cmakefileName, cmOutputConverter::NONE, runRule +=
cmOutputConverter::SHELL); this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL);
runRule += " 1"; runRule += " 1";
commands.push_back(runRule); commands.push_back(runRule);
this->CreateCDCommand(commands, this->GetBinaryDirectory(), this->CreateCDCommand(commands, this->GetBinaryDirectory(),
@ -1895,8 +1894,7 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
// Call make on the given file. // Call make on the given file.
std::string cmd; std::string cmd;
cmd += "$(MAKE) -f "; cmd += "$(MAKE) -f ";
cmd += cmd += this->ConvertToOutputFormat(makefile, cmOutputConverter::SHELL);
this->Convert(makefile, cmOutputConverter::NONE, cmOutputConverter::SHELL);
cmd += " "; cmd += " ";
cmGlobalUnixMakefileGenerator3* gg = cmGlobalUnixMakefileGenerator3* gg =

View File

@ -205,7 +205,7 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
if (workingDirectory.empty()) { if (workingDirectory.empty()) {
script += this->Convert(cmd.c_str(), START_OUTPUT, SHELL); script += this->Convert(cmd.c_str(), START_OUTPUT, SHELL);
} else { } else {
script += this->Convert(cmd.c_str(), NONE, SHELL); script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
} }
ccg.AppendArguments(c, script); ccg.AppendArguments(c, script);

View File

@ -135,8 +135,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string targetFullPathReal = outpath + targetNameReal; std::string targetFullPathReal = outpath + targetNameReal;
std::string targetFullPathPDB = pdbOutputPath + targetNamePDB; std::string targetFullPathPDB = pdbOutputPath + targetNamePDB;
std::string targetFullPathImport = outpathImp + targetNameImport; std::string targetFullPathImport = outpathImp + targetNameImport;
std::string targetOutPathPDB = this->Convert( std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL); targetFullPathPDB, cmOutputConverter::SHELL);
// Convert to the output path to use in constructing commands. // Convert to the output path to use in constructing commands.
std::string targetOutPath = this->Convert( std::string targetOutPath = this->Convert(
targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL); targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
@ -357,9 +357,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars.Manifests = manifests.c_str(); vars.Manifests = manifests.c_str();
if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) { if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
std::string cmakeCommand = std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat(
this->Convert(cmSystemTools::GetCMakeCommand(), cmLocalGenerator::NONE, cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
cmLocalGenerator::SHELL);
cmakeCommand += " -E __run_iwyu --lwyu="; cmakeCommand += " -E __run_iwyu --lwyu=";
cmakeCommand += targetOutPathReal; cmakeCommand += targetOutPathReal;
real_link_commands.push_back(cmakeCommand); real_link_commands.push_back(cmakeCommand);

View File

@ -310,8 +310,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
// Construct the output path version of the names for use in command // Construct the output path version of the names for use in command
// arguments. // arguments.
std::string targetOutPathPDB = this->Convert( std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL); targetFullPathPDB, cmOutputConverter::SHELL);
std::string targetOutPath = this->Convert( std::string targetOutPath = this->Convert(
targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL); targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
std::string targetOutPathSO = std::string targetOutPathSO =
@ -572,8 +572,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
vars.TargetInstallNameDir = ""; vars.TargetInstallNameDir = "";
} else { } else {
// Convert to a path for the native build tool. // Convert to a path for the native build tool.
install_name_dir = this->LocalGenerator->Convert( install_name_dir = this->LocalGenerator->ConvertToOutputFormat(
install_name_dir, cmOutputConverter::NONE, cmOutputConverter::SHELL); install_name_dir, cmOutputConverter::SHELL);
vars.TargetInstallNameDir = install_name_dir.c_str(); vars.TargetInstallNameDir = install_name_dir.c_str();
} }
} }
@ -640,9 +640,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
cmSystemTools::ExpandListArgument(linkRule, real_link_commands); cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE") && if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE") &&
(this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) { (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) {
std::string cmakeCommand = std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat(
this->Convert(cmSystemTools::GetCMakeCommand(), cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
cmLocalGenerator::NONE, cmLocalGenerator::SHELL);
cmakeCommand += " -E __run_iwyu --lwyu="; cmakeCommand += " -E __run_iwyu --lwyu=";
cmakeCommand += targetOutPathReal; cmakeCommand += targetOutPathReal;
real_link_commands.push_back(cmakeCommand); real_link_commands.push_back(cmakeCommand);

View File

@ -324,11 +324,11 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()(
this->Generator->LocalGenerator->AppendEcho( this->Generator->LocalGenerator->AppendEcho(
commands, copyEcho, cmLocalUnixMakefileGenerator3::EchoBuild); commands, copyEcho, cmLocalUnixMakefileGenerator3::EchoBuild);
std::string copyCommand = "$(CMAKE_COMMAND) -E copy "; std::string copyCommand = "$(CMAKE_COMMAND) -E copy ";
copyCommand += this->Generator->Convert(input, cmOutputConverter::NONE, copyCommand += this->Generator->LocalGenerator->ConvertToOutputFormat(
cmOutputConverter::SHELL); input, cmOutputConverter::SHELL);
copyCommand += " "; copyCommand += " ";
copyCommand += this->Generator->Convert(output, cmOutputConverter::NONE, copyCommand += this->Generator->LocalGenerator->ConvertToOutputFormat(
cmOutputConverter::SHELL); output, cmOutputConverter::SHELL);
commands.push_back(copyCommand); commands.push_back(copyCommand);
this->Generator->LocalGenerator->WriteMakeRule( this->Generator->LocalGenerator->WriteMakeRule(
*this->Generator->BuildFileStream, CM_NULLPTR, output, depends, commands, *this->Generator->BuildFileStream, CM_NULLPTR, output, depends, commands,
@ -464,8 +464,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
} }
// Get the output paths for source and object files. // Get the output paths for source and object files.
std::string sourceFile = this->Convert( std::string sourceFile = this->LocalGenerator->ConvertToOutputFormat(
source.GetFullPath(), cmOutputConverter::NONE, cmOutputConverter::SHELL); source.GetFullPath(), cmOutputConverter::SHELL);
// Construct the build message. // Construct the build message.
std::vector<std::string> no_commands; std::vector<std::string> no_commands;
@ -516,8 +516,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
targetOutPathReal = targetOutPathReal =
this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT, this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
cmOutputConverter::SHELL); cmOutputConverter::SHELL);
targetOutPathPDB = this->Convert( targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL); targetFullPathPDB, cmOutputConverter::SHELL);
targetOutPathCompilePDB = targetOutPathCompilePDB =
this->Convert(targetFullPathCompilePDB, cmOutputConverter::START_OUTPUT, this->Convert(targetFullPathCompilePDB, cmOutputConverter::START_OUTPUT,
cmOutputConverter::SHELL); cmOutputConverter::SHELL);
@ -539,7 +539,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
vars.TargetCompilePDB = targetOutPathCompilePDB.c_str(); vars.TargetCompilePDB = targetOutPathCompilePDB.c_str();
vars.Source = sourceFile.c_str(); vars.Source = sourceFile.c_str();
std::string shellObj = std::string shellObj =
this->Convert(obj, cmOutputConverter::NONE, cmOutputConverter::SHELL); this->LocalGenerator->ConvertToOutputFormat(obj, cmOutputConverter::SHELL);
vars.Object = shellObj.c_str(); vars.Object = shellObj.c_str();
std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT, objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT,
@ -699,8 +699,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
std::vector<std::string> preprocessCommands; std::vector<std::string> preprocessCommands;
cmSystemTools::ExpandListArgument(preprocessRule, preprocessCommands); cmSystemTools::ExpandListArgument(preprocessRule, preprocessCommands);
std::string shellObjI = this->Convert(objI, cmOutputConverter::NONE, std::string shellObjI = this->LocalGenerator->ConvertToOutputFormat(
cmOutputConverter::SHELL); objI, cmOutputConverter::SHELL);
vars.PreprocessedSource = shellObjI.c_str(); vars.PreprocessedSource = shellObjI.c_str();
// Expand placeholders in the commands. // Expand placeholders in the commands.
@ -746,8 +746,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
std::vector<std::string> assemblyCommands; std::vector<std::string> assemblyCommands;
cmSystemTools::ExpandListArgument(assemblyRule, assemblyCommands); cmSystemTools::ExpandListArgument(assemblyRule, assemblyCommands);
std::string shellObjS = this->Convert(objS, cmOutputConverter::NONE, std::string shellObjS = this->LocalGenerator->ConvertToOutputFormat(
cmOutputConverter::SHELL); objS, cmOutputConverter::SHELL);
vars.AssemblySource = shellObjS.c_str(); vars.AssemblySource = shellObjS.c_str();
// Expand placeholders in the commands. // Expand placeholders in the commands.
@ -1576,8 +1576,8 @@ void cmMakefileTargetGenerator::CreateLinkLibs(
// Reference the response file. // Reference the response file.
linkLibs = responseFlag; linkLibs = responseFlag;
linkLibs += this->Convert(link_rsp, cmOutputConverter::NONE, linkLibs += this->LocalGenerator->ConvertToOutputFormat(
cmOutputConverter::SHELL); link_rsp, cmOutputConverter::SHELL);
} }
} }
@ -1625,8 +1625,8 @@ void cmMakefileTargetGenerator::CreateObjectLists(
// Reference the response file. // Reference the response file.
buildObjs += responseFlag; buildObjs += responseFlag;
buildObjs += this->Convert(objects_rsp, cmOutputConverter::NONE, buildObjs += this->LocalGenerator->ConvertToOutputFormat(
cmOutputConverter::SHELL); objects_rsp, cmOutputConverter::SHELL);
} }
} else if (useLinkScript) { } else if (useLinkScript) {
if (!useArchiveRules) { if (!useArchiveRules) {
@ -1683,8 +1683,8 @@ void cmMakefileTargetGenerator::GenDefFile(
name_of_def_file += std::string("/") + this->GeneratorTarget->GetName(); name_of_def_file += std::string("/") + this->GeneratorTarget->GetName();
name_of_def_file += ".def"; name_of_def_file += ".def";
std::string cmd = cmSystemTools::GetCMakeCommand(); std::string cmd = cmSystemTools::GetCMakeCommand();
cmd = cmd = this->LocalGenerator->ConvertToOutputFormat(
this->Convert(cmd, cmOutputConverter::NONE, cmOutputConverter::SHELL); cmd, cmOutputConverter::SHELL);
cmd += " -E __create_def "; cmd += " -E __create_def ";
cmd += this->Convert(name_of_def_file, cmOutputConverter::START_OUTPUT, cmd += this->Convert(name_of_def_file, cmOutputConverter::START_OUTPUT,
cmOutputConverter::SHELL); cmOutputConverter::SHELL);

View File

@ -543,8 +543,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
std::string install_dir = std::string install_dir =
this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName); this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName);
if (!install_dir.empty()) { if (!install_dir.empty()) {
vars["INSTALLNAME_DIR"] = localGen.Convert( vars["INSTALLNAME_DIR"] = localGen.ConvertToOutputFormat(
install_dir, cmOutputConverter::NONE, cmOutputConverter::SHELL); install_dir, cmOutputConverter::SHELL);
} }
} }
} }