diff options
author | Brad King <brad.king@kitware.com> | 2012-03-19 15:25:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-03-19 21:13:41 (GMT) |
commit | 328c0f65c2a273c6adcdb11f96ee057d80014de2 (patch) | |
tree | f96b61b78fe9e94331ebba7c5433fabdbcff9244 /Source/cmGeneratorTarget.cxx | |
parent | 93d5509b5b1c208f3ed28daf35f9384ab6918441 (diff) | |
download | CMake-328c0f65c2a273c6adcdb11f96ee057d80014de2.zip CMake-328c0f65c2a273c6adcdb11f96ee057d80014de2.tar.gz CMake-328c0f65c2a273c6adcdb11f96ee057d80014de2.tar.bz2 |
Simplify cmVisualStudio10TargetGenerator source classification
Combine WriteCLSources and WriteObjSources into a single method. Use
the cmGeneratorTarget source classification to simplify tool selection
for each source file. Extend the classification to handle .idl files.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 4529d1c..7979928 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -37,6 +37,7 @@ void cmGeneratorTarget::ClassifySources() si != sources.end(); ++si) { cmSourceFile* sf = *si; + std::string ext = cmSystemTools::LowerCase(sf->GetExtension()); cmTarget::SourceFileFlags tsFlags = this->Target->GetTargetSourceFileFlags(sf); if(sf->GetCustomCommand()) @@ -57,16 +58,22 @@ void cmGeneratorTarget::ClassifySources() this->ExternalObjects.push_back(sf); if(isObjLib) { badObjLib.push_back(sf); } } - else if(cmSystemTools::LowerCase(sf->GetExtension()) == "def") + else if(ext == "def") { this->ModuleDefinitionFile = sf->GetFullPath(); if(isObjLib) { badObjLib.push_back(sf); } } + else if(ext == "idl") + { + this->IDLSources.push_back(sf); + if(isObjLib) { badObjLib.push_back(sf); } + } else if(this->GlobalGenerator->IgnoreFile(sf->GetExtension().c_str())) { // We only get here if a source file is not an external object // and has an extension that is listed as an ignored file type. // No message or diagnosis should be given. + this->ExtraSources.push_back(sf); } else if(sf->GetLanguage()) { @@ -75,7 +82,7 @@ void cmGeneratorTarget::ClassifySources() else { this->ExtraSources.push_back(sf); - if(isObjLib && cmSystemTools::LowerCase(sf->GetExtension()) != "txt") + if(isObjLib && ext != "txt") { badObjLib.push_back(sf); } |