fixed custom command rule
This commit is contained in:
parent
c2715d27ec
commit
56714a49d4
@ -268,35 +268,37 @@ void cmDSPMakefile::WriteDSPFile(std::ostream& fout,
|
|||||||
// Tell MS-Dev what the source is. If the compiler knows how to
|
// Tell MS-Dev what the source is. If the compiler knows how to
|
||||||
// build it, then it will.
|
// build it, then it will.
|
||||||
fout << "SOURCE=" << source.c_str() << "\n\n";
|
fout << "SOURCE=" << source.c_str() << "\n\n";
|
||||||
|
if (!commands.empty())
|
||||||
// Loop through every custom command generating code from the
|
|
||||||
// current source.
|
|
||||||
// build up the depends and outputs and commands
|
|
||||||
cmSourceGroup::CommandFiles totalCommand;
|
|
||||||
std::string totalCommandStr;
|
|
||||||
for(cmSourceGroup::Commands::const_iterator c = commands.begin();
|
|
||||||
c != commands.end(); ++c)
|
|
||||||
{
|
{
|
||||||
totalCommandStr += "\n\t";
|
// Loop through every custom command generating code from the
|
||||||
totalCommandStr += c->first;
|
// current source.
|
||||||
totalCommand.Merge(c->second);
|
// build up the depends and outputs and commands
|
||||||
}
|
cmSourceGroup::CommandFiles totalCommand;
|
||||||
// Create a dummy file with the name of the source if it does
|
std::string totalCommandStr;
|
||||||
// not exist
|
for(cmSourceGroup::Commands::const_iterator c = commands.begin();
|
||||||
if(totalCommand.m_Outputs.empty())
|
c != commands.end(); ++c)
|
||||||
{
|
|
||||||
std::string dummyFile = m_Makefile->GetStartOutputDirectory();
|
|
||||||
dummyFile += "/";
|
|
||||||
dummyFile += source;
|
|
||||||
if(!cmSystemTools::FileExists(dummyFile.c_str()))
|
|
||||||
{
|
{
|
||||||
std::ofstream fout(dummyFile.c_str());
|
totalCommandStr += "\n\t";
|
||||||
fout << "Dummy file created by cmake as unused source for utility command.\n";
|
totalCommandStr += c->first;
|
||||||
|
totalCommand.Merge(c->second);
|
||||||
|
}
|
||||||
|
// Create a dummy file with the name of the source if it does
|
||||||
|
// not exist
|
||||||
|
if(totalCommand.m_Outputs.empty())
|
||||||
|
{
|
||||||
|
std::string dummyFile = m_Makefile->GetStartOutputDirectory();
|
||||||
|
dummyFile += "/";
|
||||||
|
dummyFile += source;
|
||||||
|
if(!cmSystemTools::FileExists(dummyFile.c_str()))
|
||||||
|
{
|
||||||
|
std::ofstream fout(dummyFile.c_str());
|
||||||
|
fout << "Dummy file created by cmake as unused source for utility command.\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
|
||||||
|
totalCommand.m_Depends,
|
||||||
|
totalCommand.m_Outputs);
|
||||||
}
|
}
|
||||||
this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
|
|
||||||
totalCommand.m_Depends,
|
|
||||||
totalCommand.m_Outputs);
|
|
||||||
fout << "# End Source File\n";
|
fout << "# End Source File\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,35 +268,37 @@ void cmDSPMakefile::WriteDSPFile(std::ostream& fout,
|
|||||||
// Tell MS-Dev what the source is. If the compiler knows how to
|
// Tell MS-Dev what the source is. If the compiler knows how to
|
||||||
// build it, then it will.
|
// build it, then it will.
|
||||||
fout << "SOURCE=" << source.c_str() << "\n\n";
|
fout << "SOURCE=" << source.c_str() << "\n\n";
|
||||||
|
if (!commands.empty())
|
||||||
// Loop through every custom command generating code from the
|
|
||||||
// current source.
|
|
||||||
// build up the depends and outputs and commands
|
|
||||||
cmSourceGroup::CommandFiles totalCommand;
|
|
||||||
std::string totalCommandStr;
|
|
||||||
for(cmSourceGroup::Commands::const_iterator c = commands.begin();
|
|
||||||
c != commands.end(); ++c)
|
|
||||||
{
|
{
|
||||||
totalCommandStr += "\n\t";
|
// Loop through every custom command generating code from the
|
||||||
totalCommandStr += c->first;
|
// current source.
|
||||||
totalCommand.Merge(c->second);
|
// build up the depends and outputs and commands
|
||||||
}
|
cmSourceGroup::CommandFiles totalCommand;
|
||||||
// Create a dummy file with the name of the source if it does
|
std::string totalCommandStr;
|
||||||
// not exist
|
for(cmSourceGroup::Commands::const_iterator c = commands.begin();
|
||||||
if(totalCommand.m_Outputs.empty())
|
c != commands.end(); ++c)
|
||||||
{
|
|
||||||
std::string dummyFile = m_Makefile->GetStartOutputDirectory();
|
|
||||||
dummyFile += "/";
|
|
||||||
dummyFile += source;
|
|
||||||
if(!cmSystemTools::FileExists(dummyFile.c_str()))
|
|
||||||
{
|
{
|
||||||
std::ofstream fout(dummyFile.c_str());
|
totalCommandStr += "\n\t";
|
||||||
fout << "Dummy file created by cmake as unused source for utility command.\n";
|
totalCommandStr += c->first;
|
||||||
|
totalCommand.Merge(c->second);
|
||||||
|
}
|
||||||
|
// Create a dummy file with the name of the source if it does
|
||||||
|
// not exist
|
||||||
|
if(totalCommand.m_Outputs.empty())
|
||||||
|
{
|
||||||
|
std::string dummyFile = m_Makefile->GetStartOutputDirectory();
|
||||||
|
dummyFile += "/";
|
||||||
|
dummyFile += source;
|
||||||
|
if(!cmSystemTools::FileExists(dummyFile.c_str()))
|
||||||
|
{
|
||||||
|
std::ofstream fout(dummyFile.c_str());
|
||||||
|
fout << "Dummy file created by cmake as unused source for utility command.\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
|
||||||
|
totalCommand.m_Depends,
|
||||||
|
totalCommand.m_Outputs);
|
||||||
}
|
}
|
||||||
this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
|
|
||||||
totalCommand.m_Depends,
|
|
||||||
totalCommand.m_Outputs);
|
|
||||||
fout << "# End Source File\n";
|
fout << "# End Source File\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user