diff options
Diffstat (limited to 'Source/cmDependsC.cxx')
-rw-r--r-- | Source/cmDependsC.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 63d8fa6..6cdd4c1 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -242,13 +242,22 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, cmsys::ifstream fin(fullName.c_str()); if(fin) { - // Add this file as a dependency. - dependencies.insert(fullName); + cmsys::FStream::BOM bom = cmsys::FStream::ReadBOM(fin); + if(bom == cmsys::FStream::BOM_None || + bom == cmsys::FStream::BOM_UTF8) + { + // Add this file as a dependency. + dependencies.insert(fullName); - // Scan this file for new dependencies. Pass the directory - // containing the file to handle double-quote includes. - std::string dir = cmSystemTools::GetFilenamePath(fullName); - this->Scan(fin, dir.c_str(), fullName); + // Scan this file for new dependencies. Pass the directory + // containing the file to handle double-quote includes. + std::string dir = cmSystemTools::GetFilenamePath(fullName); + this->Scan(fin, dir.c_str(), fullName); + } + else + { + // Skip file with encoding we do not implement. + } } } } |