hopeful fix for backwards compat
This commit is contained in:
parent
050190d455
commit
b53b467414
|
@ -458,13 +458,27 @@ void cmMakefile::AddCustomCommand(const char* source,
|
||||||
for(std::vector<std::string>::const_iterator d = outputs.begin();
|
for(std::vector<std::string>::const_iterator d = outputs.begin();
|
||||||
d != outputs.end(); ++d)
|
d != outputs.end(); ++d)
|
||||||
{
|
{
|
||||||
std::vector<std::string> depends2 = depends;
|
// if this looks like a real file then use is as the main depend
|
||||||
depends2.push_back(source);
|
cmRegularExpression SourceFiles("\\.(C|M|c|c\\+\\+|cc|cpp|cxx|m|mm|rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
|
||||||
this->AddCustomCommandToOutput(d->c_str(), command, commandArgs,
|
if (SourceFiles.find(source))
|
||||||
0, depends2, comment);
|
{
|
||||||
|
this->AddCustomCommandToOutput(d->c_str(), command, commandArgs,
|
||||||
|
source, depends, comment);
|
||||||
|
}
|
||||||
|
// otherwise do not use a main depend
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::vector<std::string> depends2 = depends;
|
||||||
|
depends2.push_back(source);
|
||||||
|
this->AddCustomCommandToOutput(d->c_str(), command, commandArgs,
|
||||||
|
0, depends2, comment);
|
||||||
|
}
|
||||||
|
|
||||||
// add the output to the target?
|
// add the output to the target?
|
||||||
std::string sname = *d;
|
std::string sname = *d;
|
||||||
sname += ".rule";
|
sname += ".rule";
|
||||||
|
// if the rule was added to the source,
|
||||||
|
// then add the source to the target
|
||||||
if (!this->GetSource(sname.c_str()))
|
if (!this->GetSource(sname.c_str()))
|
||||||
{
|
{
|
||||||
if (m_Targets.find(target) != m_Targets.end())
|
if (m_Targets.find(target) != m_Targets.end())
|
||||||
|
|
Loading…
Reference in New Issue