diff options
author | Brad King <brad.king@kitware.com> | 2014-03-17 10:00:43 -0400 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-03-17 10:00:43 -0400 |
commit | b16f26f5f9cd033e24bbf398faf32369d7305bd7 (patch) | |
tree | 8502bd90002024b356d85ce8d3920c0fd65db118 /Source/cmGlobalVisualStudioGenerator.cxx | |
parent | 41b82db6855a26d01e1000b59da1792b954b326a (diff) | |
parent | 6c9dd0ec7b1e000b0bedd567fa52074671d639c9 (diff) | |
download | cmake-b16f26f5f9cd033e24bbf398faf32369d7305bd7.tar.gz |
Merge topic 'target-objects-refactor'
6c9dd0ec cmGlobalGenerator: Make ComputeTargetObjects non-virtual
c481fadc cmGeneratorTarget: Don't store ObjectSources for object libraries.
f6da0440 cmLocalGenerator: Add ComputeObjectFilenames interface.
9ad804ac cmGeneratorTarget: Constify cmSourceFile* in containers.
c725bb3c Constify some APIs in generators.
dcfcd23e cmGeneratorTarget: Make GetSourceDepends const.
04cf50ff cmOSXBundleGenerator: Make MacOSXContentGeneratorType arg const.
6132d979 cmGeneratorTarget: Constify the AddExplicitObjectName API.
bc512211 cmGeneratorTarget: Constify the AddObject API.
cd43433d cmGlobalGenerator: Extract a ComputeTargetObjectDirectory interface.
d5b2e33b Makefiles: Compute local object files on demand.
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 2b2a4715ce..38f709f42a 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -119,51 +119,12 @@ void cmGlobalVisualStudioGenerator::Generate() } //---------------------------------------------------------------------------- -void -cmGlobalVisualStudioGenerator -::ComputeTargetObjects(cmGeneratorTarget* gt) const +void cmGlobalVisualStudioGenerator +::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const { - cmLocalVisualStudioGenerator* lg = - static_cast<cmLocalVisualStudioGenerator*>(gt->LocalGenerator); - std::string dir_max = lg->ComputeLongestObjectDirectory(*gt->Target); - - // Count the number of object files with each name. Note that - // windows file names are not case sensitive. - std::map<std::string, int> counts; - std::vector<cmSourceFile*> objectSources; - gt->GetObjectSources(objectSources); - for(std::vector<cmSourceFile*>::const_iterator - si = objectSources.begin(); - si != objectSources.end(); ++si) - { - cmSourceFile* sf = *si; - std::string objectNameLower = cmSystemTools::LowerCase( - cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath())); - objectNameLower += ".obj"; - counts[objectNameLower] += 1; - } - - // For all source files producing duplicate names we need unique - // object name computation. - for(std::vector<cmSourceFile*>::const_iterator - si = objectSources.begin(); - si != objectSources.end(); ++si) - { - cmSourceFile* sf = *si; - std::string objectName = - cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()); - objectName += ".obj"; - if(counts[cmSystemTools::LowerCase(objectName)] > 1) - { - gt->AddExplicitObjectName(sf); - objectName = lg->GetObjectFileNameWithoutTarget(*sf, dir_max); - } - gt->AddObject(sf, objectName); - } - std::string dir = gt->Makefile->GetCurrentOutputDirectory(); dir += "/"; - std::string tgtDir = lg->GetTargetDirectory(*gt->Target); + std::string tgtDir = gt->LocalGenerator->GetTargetDirectory(*gt->Target); if(!tgtDir.empty()) { dir += tgtDir; @@ -919,4 +880,4 @@ std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir( i += config.size(); } return tmp; -}
\ No newline at end of file +} |