summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-03-07 19:04:33 (GMT)
committerBrad King <brad.king@kitware.com>2012-03-09 20:16:02 (GMT)
commitd57047de33e096eac6fc84976c733b7941c9add3 (patch)
treed1c9a84831140591d95919bea4683d9408a0a611 /Source/cmLocalVisualStudio7Generator.cxx
parent3baaf6ccecb9117b613fc89cd37206960298dfaa (diff)
downloadCMake-d57047de33e096eac6fc84976c733b7941c9add3.zip
CMake-d57047de33e096eac6fc84976c733b7941c9add3.tar.gz
CMake-d57047de33e096eac6fc84976c733b7941c9add3.tar.bz2
Pre-compute object file names before VS project generation
Implement cmGlobalGenerator::ComputeTargetObjects in the VS generator to pre-compute all the object file names. Use the results during generation instead of re-computing it later.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx36
1 files changed, 14 insertions, 22 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index c5714cc..ee54433 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -17,6 +17,7 @@
#include "cmSystemTools.h"
#include "cmSourceFile.h"
#include "cmCacheManager.h"
+#include "cmGeneratorTarget.h"
#include "cmake.h"
#include "cmComputeLinkInformation.h"
@@ -1310,9 +1311,6 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
sourceGroup.AssignSource(*i);
}
- // Compute which sources need unique object computation.
- this->ComputeObjectNameRequirements(classes);
-
// open the project
this->WriteProjectStart(fout, libName, target, sourceGroups);
// write the configuration information
@@ -1352,8 +1350,7 @@ public:
cmLocalVisualStudio7GeneratorFCInfo(cmLocalVisualStudio7Generator* lg,
cmTarget& target,
cmSourceFile const& sf,
- std::vector<std::string>* configs,
- std::string const& dir_max);
+ std::vector<std::string>* configs);
std::map<cmStdString, cmLVS7GFileConfig> FileConfigMap;
};
@@ -1361,13 +1358,14 @@ cmLocalVisualStudio7GeneratorFCInfo
::cmLocalVisualStudio7GeneratorFCInfo(cmLocalVisualStudio7Generator* lg,
cmTarget& target,
cmSourceFile const& sf,
- std::vector<std::string>* configs,
- std::string const& dir_max)
+ std::vector<std::string>* configs)
{
+ cmGeneratorTarget* gt =
+ lg->GetGlobalGenerator()->GetGeneratorTarget(&target);
std::string objectName;
- if(lg->NeedObjectName.find(&sf) != lg->NeedObjectName.end())
+ if(gt->ExplicitObjectName.find(&sf) != gt->ExplicitObjectName.end())
{
- objectName = lg->GetObjectFileNameWithoutTarget(sf, dir_max);
+ objectName = gt->Objects[&sf];
}
// Compute per-source, per-config information.
@@ -1478,11 +1476,11 @@ cmLocalVisualStudio7GeneratorFCInfo
}
}
-
-void cmLocalVisualStudio7Generator
-::ComputeMaxDirectoryLength(std::string& maxdir,
- cmTarget& target)
-{
+//----------------------------------------------------------------------------
+std::string
+cmLocalVisualStudio7Generator
+::ComputeLongestObjectDirectory(cmTarget& target) const
+{
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
@@ -1507,7 +1505,7 @@ void cmLocalVisualStudio7Generator
dir_max += "/";
dir_max += config_max;
dir_max += "/";
- maxdir = dir_max;
+ return dir_max;
}
void cmLocalVisualStudio7Generator
@@ -1530,19 +1528,13 @@ void cmLocalVisualStudio7Generator
this->WriteVCProjBeginGroup(fout, name.c_str(), "");
}
- // Compute the maximum length full path to the intermediate
- // files directory for any configuration. This is used to construct
- // object file names that do not produce paths that are too long.
- std::string dir_max;
- this->ComputeMaxDirectoryLength(dir_max, target);
-
// Loop through each source in the source group.
std::string objectName;
for(std::vector<const cmSourceFile *>::const_iterator sf =
sourceFiles.begin(); sf != sourceFiles.end(); ++sf)
{
std::string source = (*sf)->GetFullPath();
- FCInfo fcinfo(this, target, *(*sf), configs, dir_max);
+ FCInfo fcinfo(this, target, *(*sf), configs);
if (source != libName || target.GetType() == cmTarget::UTILITY ||
target.GetType() == cmTarget::GLOBAL_TARGET )