cmLocalGenerator: Remove unused AddBuildTargetRule method.
This commit is contained in:
parent
72f43fa13d
commit
e4dc83ade5
|
@ -526,106 +526,6 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
|
|
||||||
cmGeneratorTarget& target)
|
|
||||||
{
|
|
||||||
std::string objs;
|
|
||||||
std::vector<std::string> objVector;
|
|
||||||
std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
|
||||||
// Add all the sources outputs to the depends of the target
|
|
||||||
std::vector<cmSourceFile*> classes;
|
|
||||||
target.GetSourceFiles(classes, config);
|
|
||||||
for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
|
|
||||||
i != classes.end(); ++i)
|
|
||||||
{
|
|
||||||
cmSourceFile* sf = *i;
|
|
||||||
if(!sf->GetCustomCommand() &&
|
|
||||||
!sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
|
|
||||||
!sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
|
|
||||||
{
|
|
||||||
std::string dir_max;
|
|
||||||
dir_max += this->StateSnapshot.GetDirectory().GetCurrentBinary();
|
|
||||||
dir_max += "/";
|
|
||||||
std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_max);
|
|
||||||
if(!obj.empty())
|
|
||||||
{
|
|
||||||
std::string ofname =
|
|
||||||
this->StateSnapshot.GetDirectory().GetCurrentBinary();
|
|
||||||
ofname += "/";
|
|
||||||
ofname += obj;
|
|
||||||
objVector.push_back(ofname);
|
|
||||||
this->AddCustomCommandToCreateObject(ofname.c_str(),
|
|
||||||
llang, *(*i), target);
|
|
||||||
objs += this->Convert(ofname,START_OUTPUT,SHELL);
|
|
||||||
objs += " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::string createRule = target.GetCreateRuleVariable(llang, config);
|
|
||||||
bool useWatcomQuote = this->Makefile->IsOn(createRule+"_USE_WATCOM_QUOTE");
|
|
||||||
std::string targetName = target.Target->GetFullName();
|
|
||||||
// Executable :
|
|
||||||
// Shared Library:
|
|
||||||
// Static Library:
|
|
||||||
// Shared Module:
|
|
||||||
std::string linkLibs; // should be set
|
|
||||||
std::string frameworkPath;
|
|
||||||
std::string linkPath;
|
|
||||||
std::string flags; // should be set
|
|
||||||
std::string linkFlags; // should be set
|
|
||||||
this->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
|
|
||||||
&target, useWatcomQuote);
|
|
||||||
linkLibs = frameworkPath + linkPath + linkLibs;
|
|
||||||
cmLocalGenerator::RuleVariables vars;
|
|
||||||
vars.Language = llang.c_str();
|
|
||||||
vars.Objects = objs.c_str();
|
|
||||||
vars.ObjectDir = ".";
|
|
||||||
vars.Target = targetName.c_str();
|
|
||||||
vars.LinkLibraries = linkLibs.c_str();
|
|
||||||
vars.Flags = flags.c_str();
|
|
||||||
vars.LinkFlags = linkFlags.c_str();
|
|
||||||
|
|
||||||
std::string langFlags;
|
|
||||||
this->AddLanguageFlags(langFlags, llang, "");
|
|
||||||
this->AddArchitectureFlags(langFlags, &target, llang, "");
|
|
||||||
vars.LanguageCompileFlags = langFlags.c_str();
|
|
||||||
|
|
||||||
cmCustomCommandLines commandLines;
|
|
||||||
std::vector<std::string> rules;
|
|
||||||
rules.push_back(this->Makefile->GetRequiredDefinition(createRule));
|
|
||||||
std::vector<std::string> commands;
|
|
||||||
cmSystemTools::ExpandList(rules, commands);
|
|
||||||
for(std::vector<std::string>::iterator i = commands.begin();
|
|
||||||
i != commands.end(); ++i)
|
|
||||||
{
|
|
||||||
// Expand the full command line string.
|
|
||||||
this->ExpandRuleVariables(*i, vars);
|
|
||||||
// Parse the string to get the custom command line.
|
|
||||||
cmCustomCommandLine commandLine;
|
|
||||||
std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
|
|
||||||
commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
|
|
||||||
|
|
||||||
// Store this command line.
|
|
||||||
commandLines.push_back(commandLine);
|
|
||||||
}
|
|
||||||
std::string targetFullPath = target.Target->GetFullPath();
|
|
||||||
// Generate a meaningful comment for the command.
|
|
||||||
std::string comment = "Linking ";
|
|
||||||
comment += llang;
|
|
||||||
comment += " target ";
|
|
||||||
comment += this->Convert(targetFullPath, START_OUTPUT);
|
|
||||||
this->Makefile->AddCustomCommandToOutput(
|
|
||||||
targetFullPath,
|
|
||||||
objVector,
|
|
||||||
"",
|
|
||||||
commandLines,
|
|
||||||
comment.c_str(),
|
|
||||||
this->StateSnapshot.GetDirectory().GetCurrentBinary()
|
|
||||||
);
|
|
||||||
this->Makefile->GetSource(targetFullPath);
|
|
||||||
target.Target->AddSource(targetFullPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// List of variables that are replaced when
|
// List of variables that are replaced when
|
||||||
// rules are expanced. These variables are
|
// rules are expanced. These variables are
|
||||||
// replaced in the form <var> with GetSafeDefinition(var).
|
// replaced in the form <var> with GetSafeDefinition(var).
|
||||||
|
|
|
@ -328,11 +328,6 @@ protected:
|
||||||
void InsertRuleLauncher(std::string& s, cmTarget* target,
|
void InsertRuleLauncher(std::string& s, cmTarget* target,
|
||||||
const std::string& prop);
|
const std::string& prop);
|
||||||
|
|
||||||
|
|
||||||
/** Convert a target to a utility target for unsupported
|
|
||||||
* languages of a generator */
|
|
||||||
void AddBuildTargetRule(const std::string& llang,
|
|
||||||
cmGeneratorTarget& target);
|
|
||||||
///! add a custom command to build a .o file that is part of a target
|
///! add a custom command to build a .o file that is part of a target
|
||||||
void AddCustomCommandToCreateObject(const char* ofname,
|
void AddCustomCommandToCreateObject(const char* ofname,
|
||||||
const std::string& lang,
|
const std::string& lang,
|
||||||
|
|
Loading…
Reference in New Issue