diff options
author | Brad King <brad.king@kitware.com> | 2006-08-01 14:48:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-08-01 14:48:40 (GMT) |
commit | 8dda3a2f6e4c9832642f2f6c102897cfca0670b3 (patch) | |
tree | d2b6378f7f6090372995825d7515f0302c9bad10 /Source/cmLocalVisualStudioGenerator.cxx | |
parent | c75fb61f3c460305ec6fd7e207681fb2239beaad (diff) | |
download | CMake-8dda3a2f6e4c9832642f2f6c102897cfca0670b3.zip CMake-8dda3a2f6e4c9832642f2f6c102897cfca0670b3.tar.gz CMake-8dda3a2f6e4c9832642f2f6c102897cfca0670b3.tar.bz2 |
ENH: Adding .hh file as a C++ header file extension. Remove duplicate code from implementation of unique object name computation for VS generators. This addresses bug#3565.
Diffstat (limited to 'Source/cmLocalVisualStudioGenerator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudioGenerator.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index b4ab9e2..5ff0966 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -31,6 +31,14 @@ cmLocalVisualStudioGenerator::~cmLocalVisualStudioGenerator() } //---------------------------------------------------------------------------- +bool cmLocalVisualStudioGenerator::SourceFileCompiles(const cmSourceFile* sf) +{ + return (!sf->GetCustomCommand() && + !sf->GetPropertyAsBool("HEADER_FILE_ONLY") && + !sf->GetPropertyAsBool("EXTERNAL_OBJECT")); +} + +//---------------------------------------------------------------------------- void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements (std::vector<cmSourceGroup> const& sourceGroups) { @@ -46,14 +54,12 @@ void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements for(std::vector<const cmSourceFile*>::const_iterator s = srcs.begin(); s != srcs.end(); ++s) { - const cmSourceFile& sf = *(*s); - if(!sf.GetCustomCommand() && - !sf.GetPropertyAsBool("HEADER_FILE_ONLY") && - !sf.GetPropertyAsBool("EXTERNAL_OBJECT")) + const cmSourceFile* sf = *s; + if(this->SourceFileCompiles(sf)) { std::string objectName = cmSystemTools::GetFilenameWithoutLastExtension( - sf.GetFullPath().c_str()); + sf->GetFullPath().c_str()); objectName += ".obj"; objectNameCounts[objectName] += 1; } @@ -70,9 +76,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectNameRequirements s != srcs.end(); ++s) { const cmSourceFile* sf = *s; - if(!sf->GetCustomCommand() && - !sf->GetPropertyAsBool("HEADER_FILE_ONLY") && - !sf->GetPropertyAsBool("EXTERNAL_OBJECT")) + if(this->SourceFileCompiles(sf)) { std::string objectName = cmSystemTools::GetFilenameWithoutLastExtension( |