ENH: correctly ignore files

This commit is contained in:
Bill Hoffman 2004-09-24 08:39:02 -04:00
parent 76dac72246
commit 16c0a02d9b
2 changed files with 14 additions and 12 deletions

View File

@ -2515,11 +2515,15 @@ void cmLocalUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout)
fout << "\n\n";
}
cmStdString& cmLocalUnixMakefileGenerator::GetIncludeFlags(const char* lang)
const char* cmLocalUnixMakefileGenerator::GetIncludeFlags(const char* lang)
{
if(!lang)
{
return "";
}
if(m_LanguageToIncludeFlags.count(lang))
{
return m_LanguageToIncludeFlags[lang];
return m_LanguageToIncludeFlags[lang].c_str();
}
// Output Include paths
cmOStringStream includeFlags;
@ -2621,7 +2625,7 @@ cmStdString& cmLocalUnixMakefileGenerator::GetIncludeFlags(const char* lang)
}
flags += m_Makefile->GetDefineFlags();
m_LanguageToIncludeFlags[lang] = flags;
return m_LanguageToIncludeFlags[lang];
return m_LanguageToIncludeFlags[lang].c_str();
}
void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
@ -2819,7 +2823,8 @@ OutputBuildObjectFromSource(std::ostream& fout,
bool shared)
{
// Header files shouldn't have build rules.
if(source.GetPropertyAsBool("HEADER_FILE_ONLY"))
if(source.GetPropertyAsBool("HEADER_FILE_ONLY") ||
m_GlobalGenerator->IgnoreFile(source.GetSourceExtension().c_str()))
{
return;
}
@ -2896,11 +2901,8 @@ OutputBuildObjectFromSource(std::ostream& fout,
{
// if the language is not defined and should not be ignored,
// then produce an error
if(!m_GlobalGenerator->IgnoreFile(source.GetSourceExtension().c_str()))
{
cmSystemTools::Error("Unexpected file type ",
sourceFile.c_str());
}
cmSystemTools::Error("Unexpected file type ",
sourceFile.c_str());
}
flags += this->GetIncludeFlags(lang);
// expand multi-command semi-colon separated lists

View File

@ -240,7 +240,7 @@ protected:
*/
std::string& CreateSafeUniqueObjectFileName(const char* sin);
cmStdString& GetIncludeFlags(const char* lang);
const char* GetIncludeFlags(const char* lang);
protected:
int m_MakefileVariableSize;
std::map<cmStdString, cmStdString> m_MakeVariableMap;