cmTarget: Move link type enum out.
Remove a reason for generate time code to depend on the cmTarget header/type.
This commit is contained in:
parent
2ee1cb85e8
commit
482b3811e4
|
@ -373,13 +373,13 @@ void CCONV cmAddLinkLibraryForTarget(void *arg, const char *tgt,
|
||||||
switch (libtype)
|
switch (libtype)
|
||||||
{
|
{
|
||||||
case CM_LIBRARY_GENERAL:
|
case CM_LIBRARY_GENERAL:
|
||||||
mf->AddLinkLibraryForTarget(tgt,value, cmTarget::GENERAL);
|
mf->AddLinkLibraryForTarget(tgt,value, GENERAL_LibraryType);
|
||||||
break;
|
break;
|
||||||
case CM_LIBRARY_DEBUG:
|
case CM_LIBRARY_DEBUG:
|
||||||
mf->AddLinkLibraryForTarget(tgt,value, cmTarget::DEBUG);
|
mf->AddLinkLibraryForTarget(tgt,value, DEBUG_LibraryType);
|
||||||
break;
|
break;
|
||||||
case CM_LIBRARY_OPTIMIZED:
|
case CM_LIBRARY_OPTIMIZED:
|
||||||
mf->AddLinkLibraryForTarget(tgt,value, cmTarget::OPTIMIZED);
|
mf->AddLinkLibraryForTarget(tgt,value, OPTIMIZED_LibraryType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -482,24 +482,24 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
|
||||||
|
|
||||||
// Look for entries meant for this configuration.
|
// Look for entries meant for this configuration.
|
||||||
std::vector<cmLinkItem> actual_libs;
|
std::vector<cmLinkItem> actual_libs;
|
||||||
cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
|
cmTargetLinkLibraryType llt = GENERAL_LibraryType;
|
||||||
bool haveLLT = false;
|
bool haveLLT = false;
|
||||||
for(std::vector<std::string>::const_iterator di = deplist.begin();
|
for(std::vector<std::string>::const_iterator di = deplist.begin();
|
||||||
di != deplist.end(); ++di)
|
di != deplist.end(); ++di)
|
||||||
{
|
{
|
||||||
if(*di == "debug")
|
if(*di == "debug")
|
||||||
{
|
{
|
||||||
llt = cmTarget::DEBUG;
|
llt = DEBUG_LibraryType;
|
||||||
haveLLT = true;
|
haveLLT = true;
|
||||||
}
|
}
|
||||||
else if(*di == "optimized")
|
else if(*di == "optimized")
|
||||||
{
|
{
|
||||||
llt = cmTarget::OPTIMIZED;
|
llt = OPTIMIZED_LibraryType;
|
||||||
haveLLT = true;
|
haveLLT = true;
|
||||||
}
|
}
|
||||||
else if(*di == "general")
|
else if(*di == "general")
|
||||||
{
|
{
|
||||||
llt = cmTarget::GENERAL;
|
llt = GENERAL_LibraryType;
|
||||||
haveLLT = true;
|
haveLLT = true;
|
||||||
}
|
}
|
||||||
else if(!di->empty())
|
else if(!di->empty())
|
||||||
|
@ -517,17 +517,17 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
|
||||||
{
|
{
|
||||||
if(strcmp(val, "debug") == 0)
|
if(strcmp(val, "debug") == 0)
|
||||||
{
|
{
|
||||||
llt = cmTarget::DEBUG;
|
llt = DEBUG_LibraryType;
|
||||||
}
|
}
|
||||||
else if(strcmp(val, "optimized") == 0)
|
else if(strcmp(val, "optimized") == 0)
|
||||||
{
|
{
|
||||||
llt = cmTarget::OPTIMIZED;
|
llt = OPTIMIZED_LibraryType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the library is meant for this link type then use it.
|
// If the library is meant for this link type then use it.
|
||||||
if(llt == cmTarget::GENERAL || llt == this->LinkType)
|
if(llt == GENERAL_LibraryType || llt == this->LinkType)
|
||||||
{
|
{
|
||||||
cmLinkItem item(*di, this->FindTargetToLink(depender_index, *di));
|
cmLinkItem item(*di, this->FindTargetToLink(depender_index, *di));
|
||||||
actual_libs.push_back(item);
|
actual_libs.push_back(item);
|
||||||
|
@ -539,7 +539,7 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset the link type until another explicit type is given.
|
// Reset the link type until another explicit type is given.
|
||||||
llt = cmTarget::GENERAL;
|
llt = GENERAL_LibraryType;
|
||||||
haveLLT = false;
|
haveLLT = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ private:
|
||||||
void CheckWrongConfigItem(cmLinkItem const& item);
|
void CheckWrongConfigItem(cmLinkItem const& item);
|
||||||
|
|
||||||
int ComponentOrderId;
|
int ComponentOrderId;
|
||||||
cmTarget::LinkLibraryType LinkType;
|
cmTargetLinkLibraryType LinkType;
|
||||||
bool HasConfig;
|
bool HasConfig;
|
||||||
bool DebugMode;
|
bool DebugMode;
|
||||||
bool OldLinkDirMode;
|
bool OldLinkDirMode;
|
||||||
|
|
|
@ -120,15 +120,15 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
|
||||||
std::string ltValue;
|
std::string ltValue;
|
||||||
switch(li->second)
|
switch(li->second)
|
||||||
{
|
{
|
||||||
case cmTarget::GENERAL:
|
case GENERAL_LibraryType:
|
||||||
valueNew += "general;";
|
valueNew += "general;";
|
||||||
ltValue = "general";
|
ltValue = "general";
|
||||||
break;
|
break;
|
||||||
case cmTarget::DEBUG:
|
case DEBUG_LibraryType:
|
||||||
valueNew += "debug;";
|
valueNew += "debug;";
|
||||||
ltValue = "debug";
|
ltValue = "debug";
|
||||||
break;
|
break;
|
||||||
case cmTarget::OPTIMIZED:
|
case OPTIMIZED_LibraryType:
|
||||||
valueNew += "optimized;";
|
valueNew += "optimized;";
|
||||||
ltValue = "optimized";
|
ltValue = "optimized";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -5416,13 +5416,13 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
|
||||||
this->MaxLanguageStandards);
|
this->MaxLanguageStandards);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmTarget::LinkLibraryType linkType = this->Target->ComputeLinkType(config);
|
cmTargetLinkLibraryType linkType = this->Target->ComputeLinkType(config);
|
||||||
cmTarget::LinkLibraryVectorType const& oldllibs =
|
cmTarget::LinkLibraryVectorType const& oldllibs =
|
||||||
this->Target->GetOriginalLinkLibraries();
|
this->Target->GetOriginalLinkLibraries();
|
||||||
for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
|
for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
|
||||||
li != oldllibs.end(); ++li)
|
li != oldllibs.end(); ++li)
|
||||||
{
|
{
|
||||||
if(li->second != cmTarget::GENERAL && li->second != linkType)
|
if(li->second != GENERAL_LibraryType && li->second != linkType)
|
||||||
{
|
{
|
||||||
std::string name = this->Target->CheckCMP0004(li->first);
|
std::string name = this->Target->CheckCMP0004(li->first);
|
||||||
if(name == this->GetName() || name.empty())
|
if(name == this->GetName() || name.empty())
|
||||||
|
|
|
@ -34,7 +34,7 @@ bool cmLinkLibrariesCommand
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this->Makefile->AddLinkLibrary(*i,
|
this->Makefile->AddLinkLibrary(*i,
|
||||||
cmTarget::DEBUG);
|
DEBUG_LibraryType);
|
||||||
}
|
}
|
||||||
else if (*i == "optimized")
|
else if (*i == "optimized")
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ bool cmLinkLibrariesCommand
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this->Makefile->AddLinkLibrary(*i,
|
this->Makefile->AddLinkLibrary(*i,
|
||||||
cmTarget::OPTIMIZED);
|
OPTIMIZED_LibraryType);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ void cmLocalVisualStudio6Generator
|
||||||
libDebug =
|
libDebug =
|
||||||
this->ConvertToOutputFormat(libDebug.c_str(), SHELL);
|
this->ConvertToOutputFormat(libDebug.c_str(), SHELL);
|
||||||
|
|
||||||
if (j->second == cmTarget::GENERAL)
|
if (j->second == GENERAL_LibraryType)
|
||||||
{
|
{
|
||||||
libOptions += " ";
|
libOptions += " ";
|
||||||
libOptions += lib;
|
libOptions += lib;
|
||||||
|
@ -1156,7 +1156,7 @@ void cmLocalVisualStudio6Generator
|
||||||
libMultiLineOptionsForDebug += libDebug;
|
libMultiLineOptionsForDebug += libDebug;
|
||||||
libMultiLineOptionsForDebug += "\n";
|
libMultiLineOptionsForDebug += "\n";
|
||||||
}
|
}
|
||||||
if (j->second == cmTarget::DEBUG)
|
if (j->second == DEBUG_LibraryType)
|
||||||
{
|
{
|
||||||
libDebugOptions += " ";
|
libDebugOptions += " ";
|
||||||
libDebugOptions += lib;
|
libDebugOptions += lib;
|
||||||
|
@ -1165,7 +1165,7 @@ void cmLocalVisualStudio6Generator
|
||||||
libMultiLineDebugOptions += libDebug;
|
libMultiLineDebugOptions += libDebug;
|
||||||
libMultiLineDebugOptions += "\n";
|
libMultiLineDebugOptions += "\n";
|
||||||
}
|
}
|
||||||
if (j->second == cmTarget::OPTIMIZED)
|
if (j->second == OPTIMIZED_LibraryType)
|
||||||
{
|
{
|
||||||
libOptimizedOptions += " ";
|
libOptimizedOptions += " ";
|
||||||
libOptimizedOptions += lib;
|
libOptimizedOptions += lib;
|
||||||
|
|
|
@ -1400,7 +1400,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::AddLinkLibrary(const std::string& lib,
|
void cmMakefile::AddLinkLibrary(const std::string& lib,
|
||||||
cmTarget::LinkLibraryType llt)
|
cmTargetLinkLibraryType llt)
|
||||||
{
|
{
|
||||||
cmTarget::LibraryID tmp;
|
cmTarget::LibraryID tmp;
|
||||||
tmp.first = lib;
|
tmp.first = lib;
|
||||||
|
@ -1410,7 +1410,7 @@ void cmMakefile::AddLinkLibrary(const std::string& lib,
|
||||||
|
|
||||||
void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
|
void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
|
||||||
const std::string& lib,
|
const std::string& lib,
|
||||||
cmTarget::LinkLibraryType llt)
|
cmTargetLinkLibraryType llt)
|
||||||
{
|
{
|
||||||
cmTargets::iterator i = this->Targets.find(target);
|
cmTargets::iterator i = this->Targets.find(target);
|
||||||
if ( i != this->Targets.end())
|
if ( i != this->Targets.end())
|
||||||
|
@ -1471,7 +1471,7 @@ void cmMakefile::AddLinkDirectoryForTarget(const std::string& target,
|
||||||
|
|
||||||
void cmMakefile::AddLinkLibrary(const std::string& lib)
|
void cmMakefile::AddLinkLibrary(const std::string& lib)
|
||||||
{
|
{
|
||||||
this->AddLinkLibrary(lib,cmTarget::GENERAL);
|
this->AddLinkLibrary(lib,GENERAL_LibraryType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::InitializeFromParent(cmMakefile* parent)
|
void cmMakefile::InitializeFromParent(cmMakefile* parent)
|
||||||
|
|
|
@ -219,9 +219,9 @@ public:
|
||||||
* Add a link library to the build.
|
* Add a link library to the build.
|
||||||
*/
|
*/
|
||||||
void AddLinkLibrary(const std::string&);
|
void AddLinkLibrary(const std::string&);
|
||||||
void AddLinkLibrary(const std::string&, cmTarget::LinkLibraryType type);
|
void AddLinkLibrary(const std::string&, cmTargetLinkLibraryType type);
|
||||||
void AddLinkLibraryForTarget(const std::string& tgt, const std::string&,
|
void AddLinkLibraryForTarget(const std::string& tgt, const std::string&,
|
||||||
cmTarget::LinkLibraryType type);
|
cmTargetLinkLibraryType type);
|
||||||
void AddLinkDirectoryForTarget(const std::string& tgt, const std::string& d);
|
void AddLinkDirectoryForTarget(const std::string& tgt, const std::string& d);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -123,4 +123,10 @@ static thisClass* SafeDownCast(cmObject *c) \
|
||||||
} \
|
} \
|
||||||
class cmTypeMacro_UseTrailingSemicolon
|
class cmTypeMacro_UseTrailingSemicolon
|
||||||
|
|
||||||
|
enum cmTargetLinkLibraryType {
|
||||||
|
GENERAL_LibraryType,
|
||||||
|
DEBUG_LibraryType,
|
||||||
|
OPTIMIZED_LibraryType
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -632,13 +632,13 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmTarget::LinkLibraryType cmTarget::ComputeLinkType(
|
cmTargetLinkLibraryType cmTarget::ComputeLinkType(
|
||||||
const std::string& config) const
|
const std::string& config) const
|
||||||
{
|
{
|
||||||
// No configuration is always optimized.
|
// No configuration is always optimized.
|
||||||
if(config.empty())
|
if(config.empty())
|
||||||
{
|
{
|
||||||
return cmTarget::OPTIMIZED;
|
return OPTIMIZED_LibraryType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the list of configurations considered to be DEBUG.
|
// Get the list of configurations considered to be DEBUG.
|
||||||
|
@ -650,10 +650,10 @@ cmTarget::LinkLibraryType cmTarget::ComputeLinkType(
|
||||||
if (std::find(debugConfigs.begin(), debugConfigs.end(), configUpper) !=
|
if (std::find(debugConfigs.begin(), debugConfigs.end(), configUpper) !=
|
||||||
debugConfigs.end())
|
debugConfigs.end())
|
||||||
{
|
{
|
||||||
return cmTarget::DEBUG;
|
return DEBUG_LibraryType;
|
||||||
}
|
}
|
||||||
// The current configuration is not a debug configuration.
|
// The current configuration is not a debug configuration.
|
||||||
return cmTarget::OPTIMIZED;
|
return OPTIMIZED_LibraryType;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -693,9 +693,9 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname) const
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
|
std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
|
||||||
cmTarget::LinkLibraryType llt) const
|
cmTargetLinkLibraryType llt) const
|
||||||
{
|
{
|
||||||
if (llt == GENERAL)
|
if (llt == GENERAL_LibraryType)
|
||||||
{
|
{
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -716,7 +716,7 @@ std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
|
||||||
configString = "$<OR:" + configString + ">";
|
configString = "$<OR:" + configString + ">";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (llt == OPTIMIZED)
|
if (llt == OPTIMIZED_LibraryType)
|
||||||
{
|
{
|
||||||
configString = "$<NOT:" + configString + ">";
|
configString = "$<NOT:" + configString + ">";
|
||||||
}
|
}
|
||||||
|
@ -773,15 +773,16 @@ void cmTarget::GetTllSignatureTraces(std::ostringstream &s,
|
||||||
void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
||||||
const std::string& target,
|
const std::string& target,
|
||||||
const std::string& lib,
|
const std::string& lib,
|
||||||
LinkLibraryType llt)
|
cmTargetLinkLibraryType llt)
|
||||||
{
|
{
|
||||||
cmTarget *tgt = this->Makefile->FindTargetToUse(lib);
|
cmTarget *tgt = this->Makefile->FindTargetToUse(lib);
|
||||||
{
|
{
|
||||||
const bool isNonImportedTarget = tgt && !tgt->IsImported();
|
const bool isNonImportedTarget = tgt && !tgt->IsImported();
|
||||||
|
|
||||||
const std::string libName = (isNonImportedTarget && llt != GENERAL)
|
const std::string libName =
|
||||||
? targetNameGenex(lib)
|
(isNonImportedTarget && llt != GENERAL_LibraryType)
|
||||||
: lib;
|
? targetNameGenex(lib)
|
||||||
|
: lib;
|
||||||
this->AppendProperty("LINK_LIBRARIES",
|
this->AppendProperty("LINK_LIBRARIES",
|
||||||
this->GetDebugGeneratorExpressions(libName,
|
this->GetDebugGeneratorExpressions(libName,
|
||||||
llt).c_str());
|
llt).c_str());
|
||||||
|
@ -822,13 +823,13 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
||||||
}
|
}
|
||||||
switch (llt)
|
switch (llt)
|
||||||
{
|
{
|
||||||
case cmTarget::GENERAL:
|
case GENERAL_LibraryType:
|
||||||
dependencies += "general";
|
dependencies += "general";
|
||||||
break;
|
break;
|
||||||
case cmTarget::DEBUG:
|
case DEBUG_LibraryType:
|
||||||
dependencies += "debug";
|
dependencies += "debug";
|
||||||
break;
|
break;
|
||||||
case cmTarget::OPTIMIZED:
|
case OPTIMIZED_LibraryType:
|
||||||
dependencies += "optimized";
|
dependencies += "optimized";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1162,7 +1163,7 @@ void cmTarget::GatherDependenciesForVS6( const cmMakefile& mf,
|
||||||
|
|
||||||
// Parse the dependency information, which is a set of
|
// Parse the dependency information, which is a set of
|
||||||
// type, library pairs separated by ";". There is always a trailing ";".
|
// type, library pairs separated by ";". There is always a trailing ";".
|
||||||
cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
|
cmTargetLinkLibraryType llt = GENERAL_LibraryType;
|
||||||
std::string depline = deps;
|
std::string depline = deps;
|
||||||
std::string::size_type start = 0;
|
std::string::size_type start = 0;
|
||||||
std::string::size_type end;
|
std::string::size_type end;
|
||||||
|
@ -1174,22 +1175,22 @@ void cmTarget::GatherDependenciesForVS6( const cmMakefile& mf,
|
||||||
{
|
{
|
||||||
if (l == "debug")
|
if (l == "debug")
|
||||||
{
|
{
|
||||||
llt = cmTarget::DEBUG;
|
llt = DEBUG_LibraryType;
|
||||||
}
|
}
|
||||||
else if (l == "optimized")
|
else if (l == "optimized")
|
||||||
{
|
{
|
||||||
llt = cmTarget::OPTIMIZED;
|
llt = OPTIMIZED_LibraryType;
|
||||||
}
|
}
|
||||||
else if (l == "general")
|
else if (l == "general")
|
||||||
{
|
{
|
||||||
llt = cmTarget::GENERAL;
|
llt = GENERAL_LibraryType;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LibraryID lib2(l,llt);
|
LibraryID lib2(l,llt);
|
||||||
this->InsertDependencyForVS6( dep_map, lib, lib2);
|
this->InsertDependencyForVS6( dep_map, lib, lib2);
|
||||||
this->GatherDependenciesForVS6( mf, lib2, dep_map);
|
this->GatherDependenciesForVS6( mf, lib2, dep_map);
|
||||||
llt = cmTarget::GENERAL;
|
llt = GENERAL_LibraryType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
start = end+1; // skip the ;
|
start = end+1; // skip the ;
|
||||||
|
|
|
@ -140,17 +140,15 @@ public:
|
||||||
cmSourceFile* AddSourceCMP0049(const std::string& src);
|
cmSourceFile* AddSourceCMP0049(const std::string& src);
|
||||||
cmSourceFile* AddSource(const std::string& src);
|
cmSourceFile* AddSource(const std::string& src);
|
||||||
|
|
||||||
enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
|
|
||||||
|
|
||||||
//* how we identify a library, by name and type
|
//* how we identify a library, by name and type
|
||||||
typedef std::pair<std::string, LinkLibraryType> LibraryID;
|
typedef std::pair<std::string, cmTargetLinkLibraryType> LibraryID;
|
||||||
|
|
||||||
typedef std::vector<LibraryID > LinkLibraryVectorType;
|
typedef std::vector<LibraryID > LinkLibraryVectorType;
|
||||||
const LinkLibraryVectorType &GetOriginalLinkLibraries() const
|
const LinkLibraryVectorType &GetOriginalLinkLibraries() const
|
||||||
{return this->OriginalLinkLibraries;}
|
{return this->OriginalLinkLibraries;}
|
||||||
|
|
||||||
/** Compute the link type to use for the given configuration. */
|
/** Compute the link type to use for the given configuration. */
|
||||||
LinkLibraryType ComputeLinkType(const std::string& config) const;
|
cmTargetLinkLibraryType ComputeLinkType(const std::string& config) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the dependency information recorded for this target, if any.
|
* Clear the dependency information recorded for this target, if any.
|
||||||
|
@ -161,7 +159,7 @@ public:
|
||||||
bool NameResolvesToFramework(const std::string& libname) const;
|
bool NameResolvesToFramework(const std::string& libname) const;
|
||||||
void AddLinkLibrary(cmMakefile& mf,
|
void AddLinkLibrary(cmMakefile& mf,
|
||||||
const std::string& target, const std::string& lib,
|
const std::string& target, const std::string& lib,
|
||||||
LinkLibraryType llt);
|
cmTargetLinkLibraryType llt);
|
||||||
enum TLLSignature {
|
enum TLLSignature {
|
||||||
KeywordTLLSignature,
|
KeywordTLLSignature,
|
||||||
PlainTLLSignature
|
PlainTLLSignature
|
||||||
|
@ -297,7 +295,7 @@ public:
|
||||||
void AppendBuildInterfaceIncludes();
|
void AppendBuildInterfaceIncludes();
|
||||||
|
|
||||||
std::string GetDebugGeneratorExpressions(const std::string &value,
|
std::string GetDebugGeneratorExpressions(const std::string &value,
|
||||||
cmTarget::LinkLibraryType llt) const;
|
cmTargetLinkLibraryType llt) const;
|
||||||
|
|
||||||
void AddSystemIncludeDirectories(const std::set<std::string> &incs);
|
void AddSystemIncludeDirectories(const std::set<std::string> &incs);
|
||||||
std::set<std::string> const & GetSystemIncludeDirectories() const
|
std::set<std::string> const & GetSystemIncludeDirectories() const
|
||||||
|
|
|
@ -136,7 +136,7 @@ bool cmTargetLinkLibrariesCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep track of link configuration specifiers.
|
// Keep track of link configuration specifiers.
|
||||||
cmTarget::LinkLibraryType llt = cmTarget::GENERAL;
|
cmTargetLinkLibraryType llt = GENERAL_LibraryType;
|
||||||
bool haveLLT = false;
|
bool haveLLT = false;
|
||||||
|
|
||||||
// Start with primary linking and switch to link interface
|
// Start with primary linking and switch to link interface
|
||||||
|
@ -242,27 +242,27 @@ bool cmTargetLinkLibrariesCommand
|
||||||
{
|
{
|
||||||
if(haveLLT)
|
if(haveLLT)
|
||||||
{
|
{
|
||||||
this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::DEBUG);
|
this->LinkLibraryTypeSpecifierWarning(llt, DEBUG_LibraryType);
|
||||||
}
|
}
|
||||||
llt = cmTarget::DEBUG;
|
llt = DEBUG_LibraryType;
|
||||||
haveLLT = true;
|
haveLLT = true;
|
||||||
}
|
}
|
||||||
else if(args[i] == "optimized")
|
else if(args[i] == "optimized")
|
||||||
{
|
{
|
||||||
if(haveLLT)
|
if(haveLLT)
|
||||||
{
|
{
|
||||||
this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::OPTIMIZED);
|
this->LinkLibraryTypeSpecifierWarning(llt, OPTIMIZED_LibraryType);
|
||||||
}
|
}
|
||||||
llt = cmTarget::OPTIMIZED;
|
llt = OPTIMIZED_LibraryType;
|
||||||
haveLLT = true;
|
haveLLT = true;
|
||||||
}
|
}
|
||||||
else if(args[i] == "general")
|
else if(args[i] == "general")
|
||||||
{
|
{
|
||||||
if(haveLLT)
|
if(haveLLT)
|
||||||
{
|
{
|
||||||
this->LinkLibraryTypeSpecifierWarning(llt, cmTarget::GENERAL);
|
this->LinkLibraryTypeSpecifierWarning(llt, GENERAL_LibraryType);
|
||||||
}
|
}
|
||||||
llt = cmTarget::GENERAL;
|
llt = GENERAL_LibraryType;
|
||||||
haveLLT = true;
|
haveLLT = true;
|
||||||
}
|
}
|
||||||
else if(haveLLT)
|
else if(haveLLT)
|
||||||
|
@ -282,7 +282,7 @@ bool cmTargetLinkLibrariesCommand
|
||||||
// specifed that a library is both debug and optimized. (this check is
|
// specifed that a library is both debug and optimized. (this check is
|
||||||
// only there for backwards compatibility when mixing projects built
|
// only there for backwards compatibility when mixing projects built
|
||||||
// with old versions of CMake and new)
|
// with old versions of CMake and new)
|
||||||
llt = cmTarget::GENERAL;
|
llt = GENERAL_LibraryType;
|
||||||
std::string linkType = args[0];
|
std::string linkType = args[0];
|
||||||
linkType += "_LINK_TYPE";
|
linkType += "_LINK_TYPE";
|
||||||
const char* linkTypeString =
|
const char* linkTypeString =
|
||||||
|
@ -291,11 +291,11 @@ bool cmTargetLinkLibrariesCommand
|
||||||
{
|
{
|
||||||
if(strcmp(linkTypeString, "debug") == 0)
|
if(strcmp(linkTypeString, "debug") == 0)
|
||||||
{
|
{
|
||||||
llt = cmTarget::DEBUG;
|
llt = DEBUG_LibraryType;
|
||||||
}
|
}
|
||||||
if(strcmp(linkTypeString, "optimized") == 0)
|
if(strcmp(linkTypeString, "optimized") == 0)
|
||||||
{
|
{
|
||||||
llt = cmTarget::OPTIMIZED;
|
llt = OPTIMIZED_LibraryType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this->HandleLibrary(args[i], llt))
|
if (!this->HandleLibrary(args[i], llt))
|
||||||
|
@ -350,7 +350,7 @@ cmTargetLinkLibrariesCommand
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
|
cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
|
||||||
cmTarget::LinkLibraryType llt)
|
cmTargetLinkLibraryType llt)
|
||||||
{
|
{
|
||||||
if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
|
if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
|
||||||
&& this->CurrentProcessingState != ProcessingKeywordLinkInterface)
|
&& this->CurrentProcessingState != ProcessingKeywordLinkInterface)
|
||||||
|
@ -469,7 +469,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
|
||||||
std::string prop;
|
std::string prop;
|
||||||
|
|
||||||
// Include this library in the link interface for the target.
|
// Include this library in the link interface for the target.
|
||||||
if(llt == cmTarget::DEBUG || llt == cmTarget::GENERAL)
|
if(llt == DEBUG_LibraryType || llt == GENERAL_LibraryType)
|
||||||
{
|
{
|
||||||
// Put in the DEBUG configuration interfaces.
|
// Put in the DEBUG configuration interfaces.
|
||||||
for(std::vector<std::string>::const_iterator i = debugConfigs.begin();
|
for(std::vector<std::string>::const_iterator i = debugConfigs.begin();
|
||||||
|
@ -480,7 +480,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
|
||||||
this->Target->AppendProperty(prop, lib.c_str());
|
this->Target->AppendProperty(prop, lib.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(llt == cmTarget::OPTIMIZED || llt == cmTarget::GENERAL)
|
if(llt == OPTIMIZED_LibraryType || llt == GENERAL_LibraryType)
|
||||||
{
|
{
|
||||||
// Put in the non-DEBUG configuration interfaces.
|
// Put in the non-DEBUG configuration interfaces.
|
||||||
this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib.c_str());
|
this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib.c_str());
|
||||||
|
|
|
@ -62,7 +62,7 @@ private:
|
||||||
|
|
||||||
ProcessingState CurrentProcessingState;
|
ProcessingState CurrentProcessingState;
|
||||||
|
|
||||||
bool HandleLibrary(const std::string& lib, cmTarget::LinkLibraryType llt);
|
bool HandleLibrary(const std::string& lib, cmTargetLinkLibraryType llt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -477,7 +477,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
|
||||||
++libIt)
|
++libIt)
|
||||||
{
|
{
|
||||||
mf->AddLinkLibraryForTarget(targetName, *libIt,
|
mf->AddLinkLibraryForTarget(targetName, *libIt,
|
||||||
cmTarget::GENERAL);
|
GENERAL_LibraryType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue