Răsfoiți Sursa

ENH: Classify a file as source or header even when the extension is given
explicitly.

Amitha Perera 24 ani în urmă
părinte
comite
4ec2836634
1 a modificat fișierele cu 6 adăugiri și 2 ștergeri
  1. 6 2
      Source/cmSourceFile.cxx

+ 6 - 2
Source/cmSourceFile.cxx

@@ -90,8 +90,12 @@ void cmSourceFile::SetName(const char* name, const char* dir,
 	  m_SourceName = hname.substr(0, pos);
 	}
       }
-    
-    m_HeaderFileOnly = false;
+
+    // See if the file is a header file
+    if(std::find( headerExts.begin(), headerExts.end(), m_SourceExtension ) == headerExts.end())
+      m_HeaderFileOnly = false;
+    else
+      m_HeaderFileOnly = true;
     m_FullPath = hname;
     return;
     }