summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-09-24 12:39:02 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-09-24 12:39:02 (GMT)
commit16c0a02d9b06354a48d9eee91af702cf1a2d9646 (patch)
tree3ffeff765ac766302755aec50fcee329f8e6ea54 /Source
parent76dac72246ce0509281c7aa3a56c68c2f1751ee3 (diff)
downloadCMake-16c0a02d9b06354a48d9eee91af702cf1a2d9646.zip
CMake-16c0a02d9b06354a48d9eee91af702cf1a2d9646.tar.gz
CMake-16c0a02d9b06354a48d9eee91af702cf1a2d9646.tar.bz2
ENH: correctly ignore files
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx24
-rw-r--r--Source/cmLocalUnixMakefileGenerator.h2
2 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index 9091652..086f0b0 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -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,11 +2823,12 @@ 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;
}
-
+
std::string outputExt =
m_GlobalGenerator->GetLanguageOutputExtensionFromExtension(
source.GetSourceExtension().c_str());
@@ -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
diff --git a/Source/cmLocalUnixMakefileGenerator.h b/Source/cmLocalUnixMakefileGenerator.h
index 8a87228..1e37209 100644
--- a/Source/cmLocalUnixMakefileGenerator.h
+++ b/Source/cmLocalUnixMakefileGenerator.h
@@ -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;