Merge topic 'revert-use-generator-target'
0bbae6f Revert "Move GetLinkInformation to cmGeneratorTarget" d5cf644 Split link information processing into two steps. d8a59ea Port cmGeneratorExpression to cmTarget from cmGeneratorTarget.
This commit is contained in:
commit
9f832033d5
@ -68,7 +68,7 @@ cmGeneratorExpression::~cmGeneratorExpression()
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char *cmCompiledGeneratorExpression::Evaluate(
|
const char *cmCompiledGeneratorExpression::Evaluate(
|
||||||
cmMakefile* mf, const char* config, bool quiet,
|
cmMakefile* mf, const char* config, bool quiet,
|
||||||
cmGeneratorTarget *target,
|
cmTarget *target,
|
||||||
cmGeneratorExpressionDAGChecker *dagChecker) const
|
cmGeneratorExpressionDAGChecker *dagChecker) const
|
||||||
{
|
{
|
||||||
if (!this->NeedsParsing)
|
if (!this->NeedsParsing)
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <cmsys/RegularExpression.hxx>
|
#include <cmsys/RegularExpression.hxx>
|
||||||
|
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
class cmGeneratorTarget;
|
|
||||||
class cmMakefile;
|
class cmMakefile;
|
||||||
class cmListFileBacktrace;
|
class cmListFileBacktrace;
|
||||||
|
|
||||||
@ -68,7 +67,7 @@ class cmCompiledGeneratorExpression
|
|||||||
public:
|
public:
|
||||||
const char* Evaluate(cmMakefile* mf, const char* config,
|
const char* Evaluate(cmMakefile* mf, const char* config,
|
||||||
bool quiet = false,
|
bool quiet = false,
|
||||||
cmGeneratorTarget *target = 0,
|
cmTarget *target = 0,
|
||||||
cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
|
cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
|
||||||
|
|
||||||
/** Get set of targets found during evaluations. */
|
/** Get set of targets found during evaluations. */
|
||||||
|
@ -287,7 +287,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
|||||||
cmsys::RegularExpression propertyNameValidator;
|
cmsys::RegularExpression propertyNameValidator;
|
||||||
propertyNameValidator.compile("^[A-Za-z0-9_]+$");
|
propertyNameValidator.compile("^[A-Za-z0-9_]+$");
|
||||||
|
|
||||||
cmGeneratorTarget* target = context->Target;
|
cmTarget* target = context->Target;
|
||||||
std::string propertyName = *parameters.begin();
|
std::string propertyName = *parameters.begin();
|
||||||
if (parameters.size() == 2)
|
if (parameters.size() == 2)
|
||||||
{
|
{
|
||||||
@ -320,7 +320,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
|||||||
"Target name not supported.");
|
"Target name not supported.");
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
target = context->Makefile->FindGeneratorTargetToUse(
|
target = context->Makefile->FindTargetToUse(
|
||||||
targetName.c_str());
|
targetName.c_str());
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include "cmListFileCache.h"
|
#include "cmListFileCache.h"
|
||||||
|
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
class cmGeneratorTarget;
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
struct cmGeneratorExpressionContext
|
struct cmGeneratorExpressionContext
|
||||||
@ -27,7 +26,7 @@ struct cmGeneratorExpressionContext
|
|||||||
std::set<cmTarget*> Targets;
|
std::set<cmTarget*> Targets;
|
||||||
cmMakefile *Makefile;
|
cmMakefile *Makefile;
|
||||||
const char *Config;
|
const char *Config;
|
||||||
cmGeneratorTarget *Target;
|
cmTarget *Target;
|
||||||
bool Quiet;
|
bool Quiet;
|
||||||
bool HadError;
|
bool HadError;
|
||||||
};
|
};
|
||||||
|
@ -14,14 +14,11 @@
|
|||||||
#include "cmTarget.h"
|
#include "cmTarget.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmComputeLinkInformation.h"
|
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
#include "cmSourceFile.h"
|
#include "cmSourceFile.h"
|
||||||
#include "cmGeneratorExpression.h"
|
#include "cmGeneratorExpression.h"
|
||||||
#include "cmGeneratorExpressionDAGChecker.h"
|
#include "cmGeneratorExpressionDAGChecker.h"
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
|
cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
|
||||||
{
|
{
|
||||||
@ -32,15 +29,6 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
|
|||||||
this->LookupObjectLibraries();
|
this->LookupObjectLibraries();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmGeneratorTarget::~cmGeneratorTarget()
|
|
||||||
{
|
|
||||||
for(std::map<cmStdString, cmComputeLinkInformation*>::iterator i
|
|
||||||
= LinkInformation.begin(); i != LinkInformation.end(); ++i)
|
|
||||||
{
|
|
||||||
delete i->second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int cmGeneratorTarget::GetType() const
|
int cmGeneratorTarget::GetType() const
|
||||||
{
|
{
|
||||||
@ -220,32 +208,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,
|
void cmGeneratorTarget::GetAppleArchs(const char* config,
|
||||||
std::vector<std::string>& archVec)
|
std::vector<std::string>& archVec)
|
||||||
@ -308,7 +270,7 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
|
|||||||
.Evaluate(this->Makefile,
|
.Evaluate(this->Makefile,
|
||||||
config,
|
config,
|
||||||
false,
|
false,
|
||||||
this,
|
this->Target,
|
||||||
&dagChecker),
|
&dagChecker),
|
||||||
includes);
|
includes);
|
||||||
|
|
||||||
@ -356,6 +318,6 @@ std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
|
|||||||
return ge.Parse(prop).Evaluate(this->Makefile,
|
return ge.Parse(prop).Evaluate(this->Makefile,
|
||||||
config,
|
config,
|
||||||
false,
|
false,
|
||||||
this,
|
this->Target,
|
||||||
&dagChecker);
|
&dagChecker);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
#include "cmStandardIncludes.h"
|
#include "cmStandardIncludes.h"
|
||||||
|
|
||||||
class cmComputeLinkInformation;
|
|
||||||
class cmCustomCommand;
|
class cmCustomCommand;
|
||||||
class cmGlobalGenerator;
|
class cmGlobalGenerator;
|
||||||
class cmLocalGenerator;
|
class cmLocalGenerator;
|
||||||
@ -26,7 +25,6 @@ class cmGeneratorTarget
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGeneratorTarget(cmTarget*);
|
cmGeneratorTarget(cmTarget*);
|
||||||
~cmGeneratorTarget();
|
|
||||||
|
|
||||||
int GetType() const;
|
int GetType() const;
|
||||||
const char *GetName() const;
|
const char *GetName() const;
|
||||||
@ -60,10 +58,6 @@ public:
|
|||||||
|
|
||||||
void UseObjectLibraries(std::vector<std::string>& objs);
|
void UseObjectLibraries(std::vector<std::string>& objs);
|
||||||
|
|
||||||
std::map<cmStdString, cmComputeLinkInformation*> LinkInformation;
|
|
||||||
|
|
||||||
cmComputeLinkInformation* GetLinkInformation(const char* config);
|
|
||||||
|
|
||||||
void GetAppleArchs(const char* config,
|
void GetAppleArchs(const char* config,
|
||||||
std::vector<std::string>& archVec);
|
std::vector<std::string>& archVec);
|
||||||
|
|
||||||
|
@ -2649,8 +2649,7 @@ void cmGlobalXCodeGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compute the link library and directory information.
|
// Compute the link library and directory information.
|
||||||
cmGeneratorTarget* gtgt = this->GetGeneratorTarget(cmtarget);
|
cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName);
|
||||||
cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName);
|
|
||||||
if(!pcli)
|
if(!pcli)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
#include "cmGeneratorTarget.h"
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@ -27,8 +26,7 @@ cmInstallTargetGenerator
|
|||||||
std::vector<std::string> const& configurations,
|
std::vector<std::string> const& configurations,
|
||||||
const char* component, bool optional):
|
const char* component, bool optional):
|
||||||
cmInstallGenerator(dest, configurations, component), Target(&t),
|
cmInstallGenerator(dest, configurations, component), Target(&t),
|
||||||
ImportLibrary(implib), FilePermissions(file_permissions),
|
ImportLibrary(implib), FilePermissions(file_permissions), Optional(optional)
|
||||||
Optional(optional), GeneratorTarget(0)
|
|
||||||
{
|
{
|
||||||
this->ActionsPerConfig = true;
|
this->ActionsPerConfig = true;
|
||||||
this->NamelinkMode = NamelinkModeNone;
|
this->NamelinkMode = NamelinkModeNone;
|
||||||
@ -486,17 +484,6 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
|
|||||||
this->AddStripRule(os, indent, file);
|
this->AddStripRule(os, indent, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmInstallTargetGenerator::CreateGeneratorTarget()
|
|
||||||
{
|
|
||||||
if (!this->GeneratorTarget)
|
|
||||||
{
|
|
||||||
this->GeneratorTarget = this->Target->GetMakefile()
|
|
||||||
->GetLocalGenerator()
|
|
||||||
->GetGlobalGenerator()
|
|
||||||
->GetGeneratorTarget(this->Target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
cmInstallTargetGenerator
|
cmInstallTargetGenerator
|
||||||
@ -520,13 +507,10 @@ cmInstallTargetGenerator
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->CreateGeneratorTarget();
|
|
||||||
|
|
||||||
// Build a map of build-tree install_name to install-tree install_name for
|
// Build a map of build-tree install_name to install-tree install_name for
|
||||||
// shared libraries linked to this target.
|
// shared libraries linked to this target.
|
||||||
std::map<cmStdString, cmStdString> install_name_remap;
|
std::map<cmStdString, cmStdString> install_name_remap;
|
||||||
if(cmComputeLinkInformation* cli =
|
if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config))
|
||||||
this->GeneratorTarget->GetLinkInformation(config))
|
|
||||||
{
|
{
|
||||||
std::set<cmTarget*> const& sharedLibs = cli->GetSharedLibrariesLinked();
|
std::set<cmTarget*> const& sharedLibs = cli->GetSharedLibrariesLinked();
|
||||||
for(std::set<cmTarget*>::const_iterator j = sharedLibs.begin();
|
for(std::set<cmTarget*>::const_iterator j = sharedLibs.begin();
|
||||||
@ -624,12 +608,9 @@ cmInstallTargetGenerator
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->CreateGeneratorTarget();
|
|
||||||
|
|
||||||
// Get the link information for this target.
|
// Get the link information for this target.
|
||||||
// It can provide the RPATH.
|
// It can provide the RPATH.
|
||||||
cmComputeLinkInformation* cli =
|
cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
|
||||||
this->GeneratorTarget->GetLinkInformation(config);
|
|
||||||
if(!cli)
|
if(!cli)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -658,12 +639,9 @@ cmInstallTargetGenerator
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->CreateGeneratorTarget();
|
|
||||||
|
|
||||||
// Get the link information for this target.
|
// Get the link information for this target.
|
||||||
// It can provide the RPATH.
|
// It can provide the RPATH.
|
||||||
cmComputeLinkInformation* cli =
|
cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
|
||||||
this->GeneratorTarget->GetLinkInformation(config);
|
|
||||||
if(!cli)
|
if(!cli)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
|
|
||||||
#include "cmInstallGenerator.h"
|
#include "cmInstallGenerator.h"
|
||||||
#include "cmTarget.h"
|
#include "cmTarget.h"
|
||||||
|
#include "cmGeneratorTarget.h"
|
||||||
class cmGeneratorTarget;
|
|
||||||
|
|
||||||
/** \class cmInstallTargetGenerator
|
/** \class cmInstallTargetGenerator
|
||||||
* \brief Generate target installation rules.
|
* \brief Generate target installation rules.
|
||||||
@ -94,8 +93,6 @@ protected:
|
|||||||
void AddRanlibRule(std::ostream& os, Indent const& indent,
|
void AddRanlibRule(std::ostream& os, Indent const& indent,
|
||||||
const std::string& toDestDirPath);
|
const std::string& toDestDirPath);
|
||||||
|
|
||||||
void CreateGeneratorTarget();
|
|
||||||
|
|
||||||
cmTarget* Target;
|
cmTarget* Target;
|
||||||
bool ImportLibrary;
|
bool ImportLibrary;
|
||||||
std::string FilePermissions;
|
std::string FilePermissions;
|
||||||
|
@ -1671,7 +1671,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
|
|||||||
{
|
{
|
||||||
cmOStringStream fout;
|
cmOStringStream fout;
|
||||||
const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
|
const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
|
||||||
cmComputeLinkInformation* pcli = tgt.GetLinkInformation(config);
|
cmComputeLinkInformation* pcli = tgt.Target->GetLinkInformation(config);
|
||||||
if(!pcli)
|
if(!pcli)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -1785,10 +1785,8 @@ void cmLocalVisualStudio6Generator
|
|||||||
const std::string extraOptions,
|
const std::string extraOptions,
|
||||||
std::string& options)
|
std::string& options)
|
||||||
{
|
{
|
||||||
cmGeneratorTarget* gt =
|
|
||||||
this->GlobalGenerator->GetGeneratorTarget(&target);
|
|
||||||
// Compute the link information for this configuration.
|
// Compute the link information for this configuration.
|
||||||
cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
|
cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
|
||||||
if(!pcli)
|
if(!pcli)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -1076,9 +1076,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
|||||||
targetNameImport, targetNamePDB, configName);
|
targetNameImport, targetNamePDB, configName);
|
||||||
|
|
||||||
// Compute the link library and directory information.
|
// Compute the link library and directory information.
|
||||||
cmGeneratorTarget* gt =
|
cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
|
||||||
this->GlobalGenerator->GetGeneratorTarget(&target);
|
|
||||||
cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
|
|
||||||
if(!pcli)
|
if(!pcli)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -1163,9 +1161,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
|||||||
targetNameImport, targetNamePDB, configName);
|
targetNameImport, targetNamePDB, configName);
|
||||||
|
|
||||||
// Compute the link library and directory information.
|
// Compute the link library and directory information.
|
||||||
cmGeneratorTarget* gt =
|
cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
|
||||||
this->GlobalGenerator->GetGeneratorTarget(&target);
|
|
||||||
cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
|
|
||||||
if(!pcli)
|
if(!pcli)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -1017,8 +1017,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
|
|||||||
<< "SET(CMAKE_TARGET_LINKED_INFO_FILES\n";
|
<< "SET(CMAKE_TARGET_LINKED_INFO_FILES\n";
|
||||||
std::set<cmTarget const*> emitted;
|
std::set<cmTarget const*> emitted;
|
||||||
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
|
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
|
||||||
if(cmComputeLinkInformation* cli =
|
if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
|
||||||
this->GeneratorTarget->GetLinkInformation(cfg))
|
|
||||||
{
|
{
|
||||||
cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
|
cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
|
||||||
for(cmComputeLinkInformation::ItemVector::const_iterator
|
for(cmComputeLinkInformation::ItemVector::const_iterator
|
||||||
@ -1594,8 +1593,7 @@ void cmMakefileTargetGenerator
|
|||||||
|
|
||||||
// Loop over all library dependencies.
|
// Loop over all library dependencies.
|
||||||
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
|
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
|
||||||
if(cmComputeLinkInformation* cli =
|
if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
|
||||||
this->GeneratorTarget->GetLinkInformation(cfg))
|
|
||||||
{
|
{
|
||||||
std::vector<std::string> const& libDeps = cli->GetDepends();
|
std::vector<std::string> const& libDeps = cli->GetDepends();
|
||||||
for(std::vector<std::string>::const_iterator j = libDeps.begin();
|
for(std::vector<std::string>::const_iterator j = libDeps.begin();
|
||||||
|
@ -257,7 +257,7 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
|
|||||||
return cmNinjaDeps();
|
return cmNinjaDeps();
|
||||||
|
|
||||||
cmComputeLinkInformation* cli =
|
cmComputeLinkInformation* cli =
|
||||||
this->GeneratorTarget->GetLinkInformation(this->GetConfigName());
|
this->Target->GetLinkInformation(this->GetConfigName());
|
||||||
if(!cli)
|
if(!cli)
|
||||||
return cmNinjaDeps();
|
return cmNinjaDeps();
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "cmSourceFile.h"
|
#include "cmSourceFile.h"
|
||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
|
#include "cmComputeLinkInformation.h"
|
||||||
#include "cmDocumentCompileDefinitions.h"
|
#include "cmDocumentCompileDefinitions.h"
|
||||||
#include "cmDocumentGeneratorExpressions.h"
|
#include "cmDocumentGeneratorExpressions.h"
|
||||||
#include "cmDocumentLocationUndefined.h"
|
#include "cmDocumentLocationUndefined.h"
|
||||||
@ -4707,14 +4708,24 @@ void cmTarget::ComputeLinkImplementation(const char* config,
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(li->second == cmTarget::GENERAL || li->second == linkType)
|
if(li->second == cmTarget::GENERAL || li->second == linkType)
|
||||||
{
|
{
|
||||||
// The entry is meant for this configuration.
|
// The entry is meant for this configuration.
|
||||||
impl.Libraries.push_back(item);
|
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.
|
// Support OLD behavior for CMP0003.
|
||||||
impl.WrongConfigLibraries.push_back(item);
|
impl.WrongConfigLibraries.push_back(item);
|
||||||
}
|
}
|
||||||
@ -4803,6 +4814,32 @@ std::string cmTarget::CheckCMP0004(std::string const& item)
|
|||||||
return lib;
|
return lib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
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 cmTarget::GetFrameworkDirectory(const char* config)
|
||||||
{
|
{
|
||||||
@ -4860,6 +4897,29 @@ std::string cmTarget::GetMacContentDirectory(const char* config,
|
|||||||
return fpath;
|
return fpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
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()
|
cmTargetInternalPointer::cmTargetInternalPointer()
|
||||||
{
|
{
|
||||||
|
@ -22,8 +22,18 @@ class cmake;
|
|||||||
class cmMakefile;
|
class cmMakefile;
|
||||||
class cmSourceFile;
|
class cmSourceFile;
|
||||||
class cmGlobalGenerator;
|
class cmGlobalGenerator;
|
||||||
|
class cmComputeLinkInformation;
|
||||||
class cmListFileBacktrace;
|
class cmListFileBacktrace;
|
||||||
|
|
||||||
|
struct cmTargetLinkInformationMap:
|
||||||
|
public std::map<cmStdString, cmComputeLinkInformation*>
|
||||||
|
{
|
||||||
|
typedef std::map<cmStdString, cmComputeLinkInformation*> derived;
|
||||||
|
cmTargetLinkInformationMap() {}
|
||||||
|
cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r);
|
||||||
|
~cmTargetLinkInformationMap();
|
||||||
|
};
|
||||||
|
|
||||||
class cmTargetInternals;
|
class cmTargetInternals;
|
||||||
class cmTargetInternalPointer
|
class cmTargetInternalPointer
|
||||||
{
|
{
|
||||||
@ -392,6 +402,8 @@ public:
|
|||||||
std::string GetInstallNameDirForInstallTree(const char* config,
|
std::string GetInstallNameDirForInstallTree(const char* config,
|
||||||
bool for_xcode = false);
|
bool for_xcode = false);
|
||||||
|
|
||||||
|
cmComputeLinkInformation* GetLinkInformation(const char* config);
|
||||||
|
|
||||||
// Get the properties
|
// Get the properties
|
||||||
cmPropertyMap &GetProperties() { return this->Properties; };
|
cmPropertyMap &GetProperties() { return this->Properties; };
|
||||||
|
|
||||||
@ -584,6 +596,8 @@ private:
|
|||||||
ImportInfo const* GetImportInfo(const char* config);
|
ImportInfo const* GetImportInfo(const char* config);
|
||||||
void ComputeImportInfo(std::string const& desired_config, ImportInfo& info);
|
void ComputeImportInfo(std::string const& desired_config, ImportInfo& info);
|
||||||
|
|
||||||
|
cmTargetLinkInformationMap LinkInformation;
|
||||||
|
|
||||||
bool ComputeLinkInterface(const char* config, LinkInterface& iface);
|
bool ComputeLinkInterface(const char* config, LinkInterface& iface);
|
||||||
|
|
||||||
void ComputeLinkImplementation(const char* config,
|
void ComputeLinkImplementation(const char* config,
|
||||||
|
@ -1430,7 +1430,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
|
|||||||
// Replace spaces in libs with ;
|
// Replace spaces in libs with ;
|
||||||
cmSystemTools::ReplaceString(libs, " ", ";");
|
cmSystemTools::ReplaceString(libs, " ", ";");
|
||||||
cmComputeLinkInformation* pcli =
|
cmComputeLinkInformation* pcli =
|
||||||
this->GeneratorTarget->GetLinkInformation(config.c_str());
|
this->Target->GetLinkInformation(config.c_str());
|
||||||
if(!pcli)
|
if(!pcli)
|
||||||
{
|
{
|
||||||
cmSystemTools::Error
|
cmSystemTools::Error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user