[Cmake-commits] CMake branch, next, updated. v2.8.10.1-970-gcff920f
Stephen Kelly
steveire at gmail.com
Wed Nov 21 09:51:44 EST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via cff920ff84e0c625804ee7b8c309cedb5cc2c69e (commit)
via 0bbae6f95f55f23b758780f771bf4dd560ac2c07 (commit)
via d5cf644ac2e3f035d2d3413dd98aa0d46f9f27eb (commit)
from dccdd10ef43a3a40ef28bb400b73e4fb335563c3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cff920ff84e0c625804ee7b8c309cedb5cc2c69e
commit cff920ff84e0c625804ee7b8c309cedb5cc2c69e
Merge: dccdd10 0bbae6f
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Nov 21 09:51:41 2012 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Nov 21 09:51:41 2012 -0500
Merge topic 'revert-use-generator-target' into next
0bbae6f Revert "Move GetLinkInformation to cmGeneratorTarget"
d5cf644 Split link information processing into two steps.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bbae6f95f55f23b758780f771bf4dd560ac2c07
commit 0bbae6f95f55f23b758780f771bf4dd560ac2c07
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 5 16:14:02 2012 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Nov 21 15:49:37 2012 +0100
Revert "Move GetLinkInformation to cmGeneratorTarget"
As we can't move all linking related code from cmTarget, it makes
sense to reverse the move in some cases.
This reverts commit 4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index a68abca..de8b5e3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -14,14 +14,11 @@
#include "cmTarget.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
-#include "cmComputeLinkInformation.h"
#include "cmGlobalGenerator.h"
#include "cmSourceFile.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorExpressionDAGChecker.h"
-#include <assert.h>
-
//----------------------------------------------------------------------------
cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
{
@@ -32,15 +29,6 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
this->LookupObjectLibraries();
}
-cmGeneratorTarget::~cmGeneratorTarget()
-{
- for(std::map<cmStdString, cmComputeLinkInformation*>::iterator i
- = LinkInformation.begin(); i != LinkInformation.end(); ++i)
- {
- delete i->second;
- }
-}
-
//----------------------------------------------------------------------------
int cmGeneratorTarget::GetType() const
{
@@ -221,32 +209,6 @@ void cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs)
}
//----------------------------------------------------------------------------
-cmComputeLinkInformation*
-cmGeneratorTarget::GetLinkInformation(const char* config)
-{
- // Lookup any existing information for this configuration.
- std::map<cmStdString, cmComputeLinkInformation*>::iterator
- i = this->LinkInformation.find(config?config:"");
- if(i == this->LinkInformation.end())
- {
- // Compute information for this configuration.
- cmComputeLinkInformation* info =
- new cmComputeLinkInformation(this->Target, config);
- if(!info || !info->Compute())
- {
- delete info;
- info = 0;
- }
-
- // Store the information for this configuration.
- std::map<cmStdString, cmComputeLinkInformation*>::value_type
- entry(config?config:"", info);
- i = this->LinkInformation.insert(entry).first;
- }
- return i->second;
-}
-
-//----------------------------------------------------------------------------
void cmGeneratorTarget::GetAppleArchs(const char* config,
std::vector<std::string>& archVec)
{
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index a29a9f9..6f5ecb7 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -14,7 +14,6 @@
#include "cmStandardIncludes.h"
-class cmComputeLinkInformation;
class cmCustomCommand;
class cmGlobalGenerator;
class cmLocalGenerator;
@@ -26,7 +25,6 @@ class cmGeneratorTarget
{
public:
cmGeneratorTarget(cmTarget*);
- ~cmGeneratorTarget();
int GetType() const;
const char *GetName() const;
@@ -60,10 +58,6 @@ public:
void UseObjectLibraries(std::vector<std::string>& objs);
- std::map<cmStdString, cmComputeLinkInformation*> LinkInformation;
-
- cmComputeLinkInformation* GetLinkInformation(const char* config);
-
void GetAppleArchs(const char* config,
std::vector<std::string>& archVec);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 4ef2f57..9bbeeaf 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2649,8 +2649,7 @@ void cmGlobalXCodeGenerator
}
// Compute the link library and directory information.
- cmGeneratorTarget* gtgt = this->GetGeneratorTarget(cmtarget);
- cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName);
+ cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName);
if(!pcli)
{
continue;
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 347ad3e..5f9b658 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -16,7 +16,6 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmake.h"
-#include "cmGeneratorTarget.h"
#include <assert.h>
@@ -27,8 +26,7 @@ cmInstallTargetGenerator
std::vector<std::string> const& configurations,
const char* component, bool optional):
cmInstallGenerator(dest, configurations, component), Target(&t),
- ImportLibrary(implib), FilePermissions(file_permissions),
- Optional(optional), GeneratorTarget(0)
+ ImportLibrary(implib), FilePermissions(file_permissions), Optional(optional)
{
this->ActionsPerConfig = true;
this->NamelinkMode = NamelinkModeNone;
@@ -486,17 +484,6 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
this->AddStripRule(os, indent, file);
}
-void cmInstallTargetGenerator::CreateGeneratorTarget()
-{
- if (!this->GeneratorTarget)
- {
- this->GeneratorTarget = this->Target->GetMakefile()
- ->GetLocalGenerator()
- ->GetGlobalGenerator()
- ->GetGeneratorTarget(this->Target);
- }
-}
-
//----------------------------------------------------------------------------
void
cmInstallTargetGenerator
@@ -520,13 +507,10 @@ cmInstallTargetGenerator
return;
}
- this->CreateGeneratorTarget();
-
// Build a map of build-tree install_name to install-tree install_name for
// shared libraries linked to this target.
std::map<cmStdString, cmStdString> install_name_remap;
- if(cmComputeLinkInformation* cli =
- this->GeneratorTarget->GetLinkInformation(config))
+ if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config))
{
std::set<cmTarget*> const& sharedLibs = cli->GetSharedLibrariesLinked();
for(std::set<cmTarget*>::const_iterator j = sharedLibs.begin();
@@ -624,12 +608,9 @@ cmInstallTargetGenerator
return;
}
- this->CreateGeneratorTarget();
-
// Get the link information for this target.
// It can provide the RPATH.
- cmComputeLinkInformation* cli =
- this->GeneratorTarget->GetLinkInformation(config);
+ cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
if(!cli)
{
return;
@@ -658,12 +639,9 @@ cmInstallTargetGenerator
return;
}
- this->CreateGeneratorTarget();
-
// Get the link information for this target.
// It can provide the RPATH.
- cmComputeLinkInformation* cli =
- this->GeneratorTarget->GetLinkInformation(config);
+ cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
if(!cli)
{
return;
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index cab3e90..8cf72f9 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -14,8 +14,7 @@
#include "cmInstallGenerator.h"
#include "cmTarget.h"
-
-class cmGeneratorTarget;
+#include "cmGeneratorTarget.h"
/** \class cmInstallTargetGenerator
* \brief Generate target installation rules.
@@ -94,8 +93,6 @@ protected:
void AddRanlibRule(std::ostream& os, Indent const& indent,
const std::string& toDestDirPath);
- void CreateGeneratorTarget();
-
cmTarget* Target;
bool ImportLibrary;
std::string FilePermissions;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4952a8c..377cd09 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1671,7 +1671,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
{
cmOStringStream fout;
const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
- cmComputeLinkInformation* pcli = tgt.GetLinkInformation(config);
+ cmComputeLinkInformation* pcli = tgt.Target->GetLinkInformation(config);
if(!pcli)
{
return;
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 9497e31..6c78ac4 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1785,10 +1785,8 @@ void cmLocalVisualStudio6Generator
const std::string extraOptions,
std::string& options)
{
- cmGeneratorTarget* gt =
- this->GlobalGenerator->GetGeneratorTarget(&target);
// Compute the link information for this configuration.
- cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
+ cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
if(!pcli)
{
return;
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index d954a52..afd30f3 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1076,9 +1076,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
targetNameImport, targetNamePDB, configName);
// Compute the link library and directory information.
- cmGeneratorTarget* gt =
- this->GlobalGenerator->GetGeneratorTarget(&target);
- cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
+ cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
if(!pcli)
{
return;
@@ -1163,9 +1161,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
targetNameImport, targetNamePDB, configName);
// Compute the link library and directory information.
- cmGeneratorTarget* gt =
- this->GlobalGenerator->GetGeneratorTarget(&target);
- cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
+ cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
if(!pcli)
{
return;
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 3d02d6a..2b89c79 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1017,8 +1017,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
<< "SET(CMAKE_TARGET_LINKED_INFO_FILES\n";
std::set<cmTarget const*> emitted;
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
- if(cmComputeLinkInformation* cli =
- this->GeneratorTarget->GetLinkInformation(cfg))
+ if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
{
cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
for(cmComputeLinkInformation::ItemVector::const_iterator
@@ -1594,8 +1593,7 @@ void cmMakefileTargetGenerator
// Loop over all library dependencies.
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
- if(cmComputeLinkInformation* cli =
- this->GeneratorTarget->GetLinkInformation(cfg))
+ if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
{
std::vector<std::string> const& libDeps = cli->GetDepends();
for(std::vector<std::string>::const_iterator j = libDeps.begin();
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 0f10152..5b1dfc8 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -257,7 +257,7 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
return cmNinjaDeps();
cmComputeLinkInformation* cli =
- this->GeneratorTarget->GetLinkInformation(this->GetConfigName());
+ this->Target->GetLinkInformation(this->GetConfigName());
if(!cli)
return cmNinjaDeps();
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 214b099..be20464 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -15,6 +15,7 @@
#include "cmSourceFile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
+#include "cmComputeLinkInformation.h"
#include "cmDocumentCompileDefinitions.h"
#include "cmDocumentGeneratorExpressions.h"
#include "cmDocumentLocationUndefined.h"
@@ -4814,6 +4815,32 @@ std::string cmTarget::CheckCMP0004(std::string const& item)
}
//----------------------------------------------------------------------------
+cmComputeLinkInformation*
+cmTarget::GetLinkInformation(const char* config)
+{
+ // Lookup any existing information for this configuration.
+ std::map<cmStdString, cmComputeLinkInformation*>::iterator
+ i = this->LinkInformation.find(config?config:"");
+ if(i == this->LinkInformation.end())
+ {
+ // Compute information for this configuration.
+ cmComputeLinkInformation* info =
+ new cmComputeLinkInformation(this, config);
+ if(!info || !info->Compute())
+ {
+ delete info;
+ info = 0;
+ }
+
+ // Store the information for this configuration.
+ std::map<cmStdString, cmComputeLinkInformation*>::value_type
+ entry(config?config:"", info);
+ i = this->LinkInformation.insert(entry).first;
+ }
+ return i->second;
+}
+
+//----------------------------------------------------------------------------
std::string cmTarget::GetFrameworkDirectory(const char* config)
{
std::string fpath;
@@ -4871,6 +4898,29 @@ std::string cmTarget::GetMacContentDirectory(const char* config,
}
//----------------------------------------------------------------------------
+cmTargetLinkInformationMap
+::cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r): derived()
+{
+ // Ideally cmTarget instances should never be copied. However until
+ // we can make a sweep to remove that, this copy constructor avoids
+ // allowing the resources (LinkInformation) from getting copied. In
+ // the worst case this will lead to extra cmComputeLinkInformation
+ // instances. We also enforce in debug mode that the map be emptied
+ // when copied.
+ static_cast<void>(r);
+ assert(r.empty());
+}
+
+//----------------------------------------------------------------------------
+cmTargetLinkInformationMap::~cmTargetLinkInformationMap()
+{
+ for(derived::iterator i = this->begin(); i != this->end(); ++i)
+ {
+ delete i->second;
+ }
+}
+
+//----------------------------------------------------------------------------
cmTargetInternalPointer::cmTargetInternalPointer()
{
this->Pointer = new cmTargetInternals;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index e442d25..9efd638 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -22,8 +22,18 @@ class cmake;
class cmMakefile;
class cmSourceFile;
class cmGlobalGenerator;
+class cmComputeLinkInformation;
class cmListFileBacktrace;
+struct cmTargetLinkInformationMap:
+ public std::map<cmStdString, cmComputeLinkInformation*>
+{
+ typedef std::map<cmStdString, cmComputeLinkInformation*> derived;
+ cmTargetLinkInformationMap() {}
+ cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r);
+ ~cmTargetLinkInformationMap();
+};
+
class cmTargetInternals;
class cmTargetInternalPointer
{
@@ -392,6 +402,8 @@ public:
std::string GetInstallNameDirForInstallTree(const char* config,
bool for_xcode = false);
+ cmComputeLinkInformation* GetLinkInformation(const char* config);
+
// Get the properties
cmPropertyMap &GetProperties() { return this->Properties; };
@@ -584,6 +596,8 @@ private:
ImportInfo const* GetImportInfo(const char* config);
void ComputeImportInfo(std::string const& desired_config, ImportInfo& info);
+ cmTargetLinkInformationMap LinkInformation;
+
bool ComputeLinkInterface(const char* config, LinkInterface& iface);
void ComputeLinkImplementation(const char* config,
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d3b3950..ec9c125 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1430,7 +1430,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
// Replace spaces in libs with ;
cmSystemTools::ReplaceString(libs, " ", ";");
cmComputeLinkInformation* pcli =
- this->GeneratorTarget->GetLinkInformation(config.c_str());
+ this->Target->GetLinkInformation(config.c_str());
if(!pcli)
{
cmSystemTools::Error
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5cf644ac2e3f035d2d3413dd98aa0d46f9f27eb
commit d5cf644ac2e3f035d2d3413dd98aa0d46f9f27eb
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Nov 1 10:16:56 2012 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Nov 21 15:49:36 2012 +0100
Split link information processing into two steps.
The first step can be ported to use the generator expression API,
while the second can not. This is for compatibility with CMP0003.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 7c62ea8..214b099 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4707,14 +4707,24 @@ void cmTarget::ComputeLinkImplementation(const char* config,
{
continue;
}
-
if(li->second == cmTarget::GENERAL || li->second == linkType)
{
// The entry is meant for this configuration.
impl.Libraries.push_back(item);
}
- else
+ }
+
+ LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
+ for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
+ li != oldllibs.end(); ++li)
+ {
+ if(li->second != cmTarget::GENERAL && li->second != linkType)
{
+ std::string item = this->CheckCMP0004(li->first);
+ if(item == this->GetName() || item.empty())
+ {
+ continue;
+ }
// Support OLD behavior for CMP0003.
impl.WrongConfigLibraries.push_back(item);
}
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list