diff --git a/Source/cmBorlandMakefileGenerator.cxx b/Source/cmBorlandMakefileGenerator.cxx index ce70055be..c3a8ac92d 100644 --- a/Source/cmBorlandMakefileGenerator.cxx +++ b/Source/cmBorlandMakefileGenerator.cxx @@ -178,7 +178,11 @@ OutputBuildObjectFromSource(std::ostream& fout, const cmSourceFile& source, const char* extraCompileFlags, bool shared) -{ +{ + // Header files shouldn't have build rules. + if(source.IsAHeaderFileOnly()) + return; + std::string comment = "Build "; std::string objectFile = std::string(shortName) + this->GetOutputExtension(source.GetSourceExtension().c_str()); diff --git a/Source/cmNMakeMakefileGenerator.cxx b/Source/cmNMakeMakefileGenerator.cxx index fca80a7d9..4e4b3ed54 100644 --- a/Source/cmNMakeMakefileGenerator.cxx +++ b/Source/cmNMakeMakefileGenerator.cxx @@ -356,6 +356,10 @@ OutputBuildObjectFromSource(std::ostream& fout, const char* extraCompileFlags, bool shared) { + // Header files shouldn't have build rules. + if(source.IsAHeaderFileOnly()) + return; + std::string comment = "Build "; std::string objectFile = std::string(shortName) + this->GetOutputExtension(source.GetSourceExtension().c_str()); diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 4e7729377..ca4e0899b 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -1594,7 +1594,10 @@ OutputBuildObjectFromSource(std::ostream& fout, const char* extraCompileFlags, bool shared) { - + // Header files shouldn't have build rules. + if(source.IsAHeaderFileOnly()) + return; + std::string comment = "Build "; std::string objectFile = std::string(shortName) + m_ObjectFileExtension; comment += objectFile + " From ";