Convert: Inline uses of START_OUTPUT
This commit is contained in:
parent
4cf707b083
commit
ad79061720
|
@ -1409,7 +1409,9 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Normal behavior.
|
// Normal behavior.
|
||||||
return this->Convert(lib, START_OUTPUT, format);
|
return this->ConvertToOutputFormat(
|
||||||
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), lib),
|
||||||
|
format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -500,8 +500,10 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
|
||||||
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
||||||
if (!outputs.empty()) {
|
if (!outputs.empty()) {
|
||||||
if (ccg.GetWorkingDirectory().empty()) {
|
if (ccg.GetWorkingDirectory().empty()) {
|
||||||
output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
|
output = this->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(),
|
||||||
|
outputs[0]),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
} else {
|
} else {
|
||||||
output =
|
output =
|
||||||
this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
|
this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
|
||||||
|
|
|
@ -1002,8 +1002,10 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
|
||||||
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
||||||
if (!outputs.empty()) {
|
if (!outputs.empty()) {
|
||||||
if (workingDir.empty()) {
|
if (workingDir.empty()) {
|
||||||
output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
|
output = this->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(),
|
||||||
|
outputs[0]),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
output = this->ConvertToOutputFormat(outputs[0],
|
output = this->ConvertToOutputFormat(outputs[0],
|
||||||
|
@ -1095,8 +1097,9 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
|
||||||
fout << ")\n";
|
fout << ")\n";
|
||||||
}
|
}
|
||||||
std::string remove = "$(CMAKE_COMMAND) -P ";
|
std::string remove = "$(CMAKE_COMMAND) -P ";
|
||||||
remove += this->Convert(cleanfile, cmOutputConverter::START_OUTPUT,
|
remove += this->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), cleanfile),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
commands.push_back(remove);
|
commands.push_back(remove);
|
||||||
|
|
||||||
// For the main clean rule add per-language cleaning.
|
// For the main clean rule add per-language cleaning.
|
||||||
|
|
|
@ -205,7 +205,9 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workingDirectory.empty()) {
|
if (workingDirectory.empty()) {
|
||||||
script += this->Convert(cmd.c_str(), START_OUTPUT, SHELL);
|
script += this->ConvertToOutputFormat(
|
||||||
|
this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), cmd),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
} else {
|
} else {
|
||||||
script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
|
script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,14 +138,20 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
||||||
std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathPDB, 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->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
std::string targetOutPathReal =
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath),
|
||||||
this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
|
cmOutputConverter::SHELL);
|
||||||
cmOutputConverter::SHELL);
|
std::string targetOutPathReal = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
std::string targetOutPathImport =
|
std::string targetOutPathImport =
|
||||||
this->Convert(targetFullPathImport, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
targetFullPathImport),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
// Get the language to use for linking this executable.
|
// Get the language to use for linking this executable.
|
||||||
std::string linkLanguage =
|
std::string linkLanguage =
|
||||||
|
@ -319,14 +325,19 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
|
||||||
vars.Language = linkLanguage.c_str();
|
vars.Language = linkLanguage.c_str();
|
||||||
vars.Objects = buildObjs.c_str();
|
vars.Objects = buildObjs.c_str();
|
||||||
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
||||||
objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT,
|
|
||||||
cmOutputConverter::SHELL);
|
objectDir = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objectDir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
vars.ObjectDir = objectDir.c_str();
|
vars.ObjectDir = objectDir.c_str();
|
||||||
cmOutputConverter::OutputFormat output = (useWatcomQuote)
|
cmOutputConverter::OutputFormat output = (useWatcomQuote)
|
||||||
? cmOutputConverter::WATCOMQUOTE
|
? cmOutputConverter::WATCOMQUOTE
|
||||||
: cmOutputConverter::SHELL;
|
: cmOutputConverter::SHELL;
|
||||||
std::string target = this->Convert(
|
std::string target = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathReal, cmOutputConverter::START_OUTPUT, output);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
output);
|
||||||
vars.Target = target.c_str();
|
vars.Target = target.c_str();
|
||||||
vars.TargetPDB = targetOutPathPDB.c_str();
|
vars.TargetPDB = targetOutPathPDB.c_str();
|
||||||
|
|
||||||
|
|
|
@ -312,17 +312,25 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
|
||||||
// arguments.
|
// arguments.
|
||||||
std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathPDB, cmOutputConverter::SHELL);
|
targetFullPathPDB, cmOutputConverter::SHELL);
|
||||||
std::string targetOutPath = this->Convert(
|
|
||||||
targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
|
std::string targetOutPath = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
std::string targetOutPathSO =
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
this->Convert(targetFullPathSO, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath),
|
||||||
cmOutputConverter::SHELL);
|
cmOutputConverter::SHELL);
|
||||||
std::string targetOutPathReal =
|
std::string targetOutPathSO = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathSO),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
std::string targetOutPathReal = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
std::string targetOutPathImport =
|
std::string targetOutPathImport =
|
||||||
this->Convert(targetFullPathImport, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
targetFullPathImport),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
this->NumberOfProgressActions++;
|
this->NumberOfProgressActions++;
|
||||||
if (!this->NoRuleMessages) {
|
if (!this->NoRuleMessages) {
|
||||||
|
@ -536,14 +544,20 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
|
||||||
vars.Language = linkLanguage.c_str();
|
vars.Language = linkLanguage.c_str();
|
||||||
vars.Objects = buildObjs.c_str();
|
vars.Objects = buildObjs.c_str();
|
||||||
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
|
||||||
objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT,
|
|
||||||
cmOutputConverter::SHELL);
|
objectDir = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objectDir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
vars.ObjectDir = objectDir.c_str();
|
vars.ObjectDir = objectDir.c_str();
|
||||||
cmOutputConverter::OutputFormat output = (useWatcomQuote)
|
cmOutputConverter::OutputFormat output = (useWatcomQuote)
|
||||||
? cmOutputConverter::WATCOMQUOTE
|
? cmOutputConverter::WATCOMQUOTE
|
||||||
: cmOutputConverter::SHELL;
|
: cmOutputConverter::SHELL;
|
||||||
std::string target = this->Convert(
|
std::string target = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathReal, cmOutputConverter::START_OUTPUT, output);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
output);
|
||||||
vars.Target = target.c_str();
|
vars.Target = target.c_str();
|
||||||
vars.LinkLibraries = linkLibs.c_str();
|
vars.LinkLibraries = linkLibs.c_str();
|
||||||
vars.ObjectsQuoted = buildObjs.c_str();
|
vars.ObjectsQuoted = buildObjs.c_str();
|
||||||
|
|
|
@ -526,14 +526,17 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
targetOutPathReal =
|
targetOutPathReal = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
targetFullPathPDB, cmOutputConverter::SHELL);
|
targetFullPathPDB, cmOutputConverter::SHELL);
|
||||||
targetOutPathCompilePDB =
|
targetOutPathCompilePDB = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
this->Convert(targetFullPathCompilePDB, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||||
|
targetFullPathCompilePDB),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
|
|
||||||
if (this->LocalGenerator->IsMinGWMake() &&
|
if (this->LocalGenerator->IsMinGWMake() &&
|
||||||
cmHasLiteralSuffix(targetOutPathCompilePDB, "\\")) {
|
cmHasLiteralSuffix(targetOutPathCompilePDB, "\\")) {
|
||||||
|
@ -555,12 +558,16 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
|
||||||
this->LocalGenerator->ConvertToOutputFormat(obj, 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->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objectDir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
vars.ObjectDir = objectDir.c_str();
|
vars.ObjectDir = objectDir.c_str();
|
||||||
std::string objectFileDir = cmSystemTools::GetFilenamePath(obj);
|
std::string objectFileDir = cmSystemTools::GetFilenamePath(obj);
|
||||||
objectFileDir = this->Convert(objectFileDir, cmOutputConverter::START_OUTPUT,
|
objectFileDir = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objectFileDir),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
vars.ObjectFileDir = objectFileDir.c_str();
|
vars.ObjectFileDir = objectFileDir.c_str();
|
||||||
vars.Flags = flags.c_str();
|
vars.Flags = flags.c_str();
|
||||||
|
|
||||||
|
@ -1231,8 +1238,10 @@ public:
|
||||||
void Feed(std::string const& obj)
|
void Feed(std::string const& obj)
|
||||||
{
|
{
|
||||||
// Construct the name of the next object.
|
// Construct the name of the next object.
|
||||||
this->NextObject = this->LocalGenerator->Convert(
|
this->NextObject = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
obj, cmOutputConverter::START_OUTPUT, cmOutputConverter::RESPONSE);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), obj),
|
||||||
|
cmOutputConverter::RESPONSE);
|
||||||
|
|
||||||
// Roll over to next string if the limit will be exceeded.
|
// Roll over to next string if the limit will be exceeded.
|
||||||
if (this->LengthLimit != std::string::npos &&
|
if (this->LengthLimit != std::string::npos &&
|
||||||
|
@ -1474,8 +1483,10 @@ void cmMakefileTargetGenerator::CreateLinkScript(
|
||||||
|
|
||||||
// Create the makefile command to invoke the link script.
|
// Create the makefile command to invoke the link script.
|
||||||
std::string link_command = "$(CMAKE_COMMAND) -E cmake_link_script ";
|
std::string link_command = "$(CMAKE_COMMAND) -E cmake_link_script ";
|
||||||
link_command += this->Convert(
|
link_command += this->LocalGenerator->ConvertToOutputFormat(
|
||||||
linkScriptName, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), linkScriptName),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
link_command += " --verbose=$(VERBOSE)";
|
link_command += " --verbose=$(VERBOSE)";
|
||||||
makefile_commands.push_back(link_command);
|
makefile_commands.push_back(link_command);
|
||||||
makefile_depends.push_back(linkScriptName);
|
makefile_depends.push_back(linkScriptName);
|
||||||
|
@ -1506,9 +1517,9 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
|
||||||
if (size_t const limit = calculateCommandLineLengthLimit()) {
|
if (size_t const limit = calculateCommandLineLengthLimit()) {
|
||||||
// Compute the total length of our list of object files with room
|
// Compute the total length of our list of object files with room
|
||||||
// for argument separation and quoting. This does not convert paths
|
// for argument separation and quoting. This does not convert paths
|
||||||
// relative to START_OUTPUT like the final list will be, so the actual
|
// relative to CMAKE_CURRENT_BINARY_DIR like the final list will be, so the
|
||||||
// list will likely be much shorter than this. However, in the worst
|
// actual list will likely be much shorter than this. However, in the
|
||||||
// case all objects will remain as absolute paths.
|
// worst case all objects will remain as absolute paths.
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
for (std::vector<std::string>::const_iterator i = this->Objects.begin();
|
for (std::vector<std::string>::const_iterator i = this->Objects.begin();
|
||||||
i != this->Objects.end(); ++i) {
|
i != this->Objects.end(); ++i) {
|
||||||
|
@ -1709,13 +1720,17 @@ void cmMakefileTargetGenerator::GenDefFile(
|
||||||
cmd = this->LocalGenerator->ConvertToOutputFormat(
|
cmd = this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmd, 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->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), name_of_def_file),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
cmd += " ";
|
cmd += " ";
|
||||||
std::string objlist_file = name_of_def_file;
|
std::string objlist_file = name_of_def_file;
|
||||||
objlist_file += ".objs";
|
objlist_file += ".objs";
|
||||||
cmd += this->Convert(objlist_file, cmOutputConverter::START_OUTPUT,
|
cmd += this->LocalGenerator->ConvertToOutputFormat(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
|
this->LocalGenerator->GetCurrentBinaryDirectory(), objlist_file),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
real_link_commands.insert(real_link_commands.begin(), cmd);
|
real_link_commands.insert(real_link_commands.begin(), cmd);
|
||||||
// create a list of obj files for the -E __create_def to read
|
// create a list of obj files for the -E __create_def to read
|
||||||
cmGeneratedFileStream fout(objlist_file.c_str());
|
cmGeneratedFileStream fout(objlist_file.c_str());
|
||||||
|
@ -1733,9 +1748,10 @@ void cmMakefileTargetGenerator::GenDefFile(
|
||||||
// now add the def file link flag
|
// now add the def file link flag
|
||||||
linkFlags += " ";
|
linkFlags += " ";
|
||||||
linkFlags += this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
|
linkFlags += this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
|
||||||
linkFlags +=
|
linkFlags += this->LocalGenerator->ConvertToOutputFormat(
|
||||||
this->Convert(name_of_def_file, cmOutputConverter::START_OUTPUT,
|
this->LocalGenerator->ConvertToRelativePath(
|
||||||
cmOutputConverter::SHELL);
|
this->LocalGenerator->GetCurrentBinaryDirectory(), name_of_def_file),
|
||||||
|
cmOutputConverter::SHELL);
|
||||||
linkFlags += " ";
|
linkFlags += " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue