summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-16 18:30:24 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-16 18:30:24 (GMT)
commit921f3a1ac233c121b8cf7cbf896bc4c88717c9a8 (patch)
treea4b5f4f972ce69a87d7433466562852d372b59b1 /Source/cmGlobalXCodeGenerator.cxx
parent147d6f31015a64b3ec1b3799d4c0047942b27999 (diff)
downloadCMake-921f3a1ac233c121b8cf7cbf896bc4c88717c9a8.zip
CMake-921f3a1ac233c121b8cf7cbf896bc4c88717c9a8.tar.gz
CMake-921f3a1ac233c121b8cf7cbf896bc4c88717c9a8.tar.bz2
BUG: Do not automatically set HEADER_FILE_ONLY
Long ago the native build system generators needed HEADER_FILE_ONLY to be set on header files to stop them from building. The modern generators correctly handle headers without the help of this property. This removes automatic setting of the property so that it can be used reliably as an indicator of project author intention. It fixes VS IDE project files to show header files normally instead of excluded (broken by the fix for issue #7845).
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index db1d78f..3fd14a9 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -732,7 +732,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
{
externalObjFiles.push_back(xsf);
}
- else if((*i)->GetPropertyAsBool("HEADER_FILE_ONLY") ||
+ else if(this->IsHeaderFile(*i) ||
(tsFlags.Type == cmTarget::SourceFileTypePrivateHeader) ||
(tsFlags.Type == cmTarget::SourceFileTypePublicHeader))
{
@@ -742,7 +742,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
{
resourceFiles.push_back(xsf);
}
- else
+ else if(!(*i)->GetPropertyAsBool("HEADER_FILE_ONLY"))
{
// Include this file in the build if it has a known language
// and has not been listed as an ignored extension for this
@@ -912,6 +912,15 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
}
//----------------------------------------------------------------------------
+bool cmGlobalXCodeGenerator::IsHeaderFile(cmSourceFile* sf)
+{
+ const std::vector<std::string>& hdrExts =
+ this->CurrentMakefile->GetHeaderExtensions();
+ return (std::find(hdrExts.begin(), hdrExts.end(), sf->GetExtension()) !=
+ hdrExts.end());
+}
+
+//----------------------------------------------------------------------------
cmXCodeObject*
cmGlobalXCodeGenerator::CreateBuildPhase(const char* name,
const char* name2,