Merge topic 'target-legacy-depends-only-for-vs6'
8a205b98 cmTarget: Compile old-style link dependencies only for VS 6 d57be904 cmTarget: Run old-style link dependencies only for VS 6 b3b44d13 cmTarget: Rename old-style link dependencies code as "ForVS6" 80cb12bb export_library_dependencies: Use original link libraries internally
This commit is contained in:
commit
49bf3e7d8d
@ -108,14 +108,12 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
|
|||||||
std::string targetEntry = target.GetName();
|
std::string targetEntry = target.GetName();
|
||||||
targetEntry += "_LIB_DEPENDS";
|
targetEntry += "_LIB_DEPENDS";
|
||||||
|
|
||||||
// Construct the dependency variable value. It is safe to use
|
// Construct the dependency variable value with the direct link
|
||||||
// the target GetLinkLibraries method here because this code is
|
// dependencies.
|
||||||
// called at the end of configure but before generate so library
|
|
||||||
// dependencies have yet to be analyzed. Therefore the value
|
|
||||||
// will be the direct link dependencies.
|
|
||||||
std::string valueOld;
|
std::string valueOld;
|
||||||
std::string valueNew;
|
std::string valueNew;
|
||||||
cmTarget::LinkLibraryVectorType const& libs = target.GetLinkLibraries();
|
cmTarget::LinkLibraryVectorType const& libs =
|
||||||
|
target.GetOriginalLinkLibraries();
|
||||||
for(cmTarget::LinkLibraryVectorType::const_iterator li = libs.begin();
|
for(cmTarget::LinkLibraryVectorType::const_iterator li = libs.begin();
|
||||||
li != libs.end(); ++li)
|
li != libs.end(); ++li)
|
||||||
{
|
{
|
||||||
|
@ -214,6 +214,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void FindMakeProgram(cmMakefile*);
|
virtual void FindMakeProgram(cmMakefile*);
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
/** Is this the Visual Studio 6 generator? */
|
||||||
|
virtual bool IsForVS6() const { return false; }
|
||||||
|
#endif
|
||||||
|
|
||||||
///! Find a target by name by searching the local generators.
|
///! Find a target by name by searching the local generators.
|
||||||
cmTarget* FindTarget(const std::string& name,
|
cmTarget* FindTarget(const std::string& name,
|
||||||
bool excludeAliases = false) const;
|
bool excludeAliases = false) const;
|
||||||
|
@ -91,6 +91,8 @@ public:
|
|||||||
|
|
||||||
virtual void FindMakeProgram(cmMakefile*);
|
virtual void FindMakeProgram(cmMakefile*);
|
||||||
|
|
||||||
|
virtual bool IsForVS6() const { return true; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual const char* GetIDEVersion() { return "6.0"; }
|
virtual const char* GetIDEVersion() { return "6.0"; }
|
||||||
private:
|
private:
|
||||||
|
@ -1101,7 +1101,8 @@ void cmLocalVisualStudio6Generator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// find link libraries
|
// find link libraries
|
||||||
const cmTarget::LinkLibraryVectorType& libs = target.GetLinkLibraries();
|
const cmTarget::LinkLibraryVectorType& libs =
|
||||||
|
target.GetLinkLibrariesForVS6();
|
||||||
cmTarget::LinkLibraryVectorType::const_iterator j;
|
cmTarget::LinkLibraryVectorType::const_iterator j;
|
||||||
for(j = libs.begin(); j != libs.end(); ++j)
|
for(j = libs.begin(); j != libs.end(); ++j)
|
||||||
{
|
{
|
||||||
|
@ -258,7 +258,9 @@ cmTarget::cmTarget()
|
|||||||
#undef INITIALIZE_TARGET_POLICY_MEMBER
|
#undef INITIALIZE_TARGET_POLICY_MEMBER
|
||||||
|
|
||||||
this->Makefile = 0;
|
this->Makefile = 0;
|
||||||
this->LinkLibrariesAnalyzed = false;
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
this->LinkLibrariesForVS6Analyzed = false;
|
||||||
|
#endif
|
||||||
this->HaveInstallRule = false;
|
this->HaveInstallRule = false;
|
||||||
this->DLLPlatform = false;
|
this->DLLPlatform = false;
|
||||||
this->IsApple = false;
|
this->IsApple = false;
|
||||||
@ -517,8 +519,13 @@ void cmTarget::FinishConfigure()
|
|||||||
// invalidation code in this source file is buggy.
|
// invalidation code in this source file is buggy.
|
||||||
this->ClearLinkMaps();
|
this->ClearLinkMaps();
|
||||||
|
|
||||||
// Do old-style link dependency analysis.
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
this->AnalyzeLibDependencies(*this->Makefile);
|
// Do old-style link dependency analysis only for CM_USE_OLD_VS6.
|
||||||
|
if(this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->IsForVS6())
|
||||||
|
{
|
||||||
|
this->AnalyzeLibDependenciesForVS6(*this->Makefile);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -1332,7 +1339,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
|||||||
cmTarget::LibraryID tmp;
|
cmTarget::LibraryID tmp;
|
||||||
tmp.first = lib;
|
tmp.first = lib;
|
||||||
tmp.second = llt;
|
tmp.second = llt;
|
||||||
this->LinkLibraries.push_back( tmp );
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
this->LinkLibrariesForVS6.push_back( tmp );
|
||||||
|
#endif
|
||||||
this->OriginalLinkLibraries.push_back(tmp);
|
this->OriginalLinkLibraries.push_back(tmp);
|
||||||
this->ClearLinkMaps();
|
this->ClearLinkMaps();
|
||||||
|
|
||||||
@ -1398,9 +1407,10 @@ cmTarget::AddSystemIncludeDirectories(const std::vector<std::string> &incs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
cmTarget::AnalyzeLibDependencies( const cmMakefile& mf )
|
cmTarget::AnalyzeLibDependenciesForVS6( const cmMakefile& mf )
|
||||||
{
|
{
|
||||||
// There are two key parts of the dependency analysis: (1)
|
// There are two key parts of the dependency analysis: (1)
|
||||||
// determining the libraries in the link line, and (2) constructing
|
// determining the libraries in the link line, and (2) constructing
|
||||||
@ -1477,8 +1487,8 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf )
|
|||||||
// eventually be removed. This code was moved here from the end of
|
// eventually be removed. This code was moved here from the end of
|
||||||
// old source list processing code which was called just before this
|
// old source list processing code which was called just before this
|
||||||
// method.
|
// method.
|
||||||
for(LinkLibraryVectorType::iterator p = this->LinkLibraries.begin();
|
for(LinkLibraryVectorType::iterator p = this->LinkLibrariesForVS6.begin();
|
||||||
p != this->LinkLibraries.end(); ++p)
|
p != this->LinkLibrariesForVS6.end(); ++p)
|
||||||
{
|
{
|
||||||
this->Makefile->ExpandVariablesInString(p->first, true, true);
|
this->Makefile->ExpandVariablesInString(p->first, true, true);
|
||||||
}
|
}
|
||||||
@ -1490,22 +1500,22 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf )
|
|||||||
// 1. Build the dependency graph
|
// 1. Build the dependency graph
|
||||||
//
|
//
|
||||||
for(LinkLibraryVectorType::reverse_iterator lib
|
for(LinkLibraryVectorType::reverse_iterator lib
|
||||||
= this->LinkLibraries.rbegin();
|
= this->LinkLibrariesForVS6.rbegin();
|
||||||
lib != this->LinkLibraries.rend(); ++lib)
|
lib != this->LinkLibrariesForVS6.rend(); ++lib)
|
||||||
{
|
{
|
||||||
this->GatherDependencies( mf, *lib, dep_map);
|
this->GatherDependenciesForVS6( mf, *lib, dep_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Remove any dependencies that are already satisfied in the original
|
// 2. Remove any dependencies that are already satisfied in the original
|
||||||
// link line.
|
// link line.
|
||||||
//
|
//
|
||||||
for(LinkLibraryVectorType::iterator lib = this->LinkLibraries.begin();
|
for(LinkLibraryVectorType::iterator lib = this->LinkLibrariesForVS6.begin();
|
||||||
lib != this->LinkLibraries.end(); ++lib)
|
lib != this->LinkLibrariesForVS6.end(); ++lib)
|
||||||
{
|
{
|
||||||
for( LinkLibraryVectorType::iterator lib2 = lib;
|
for( LinkLibraryVectorType::iterator lib2 = lib;
|
||||||
lib2 != this->LinkLibraries.end(); ++lib2)
|
lib2 != this->LinkLibrariesForVS6.end(); ++lib2)
|
||||||
{
|
{
|
||||||
this->DeleteDependency( dep_map, *lib, *lib2);
|
this->DeleteDependencyForVS6( dep_map, *lib, *lib2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1514,43 +1524,43 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf )
|
|||||||
// missing. Start from the back and keep adding.
|
// missing. Start from the back and keep adding.
|
||||||
//
|
//
|
||||||
std::set<DependencyMap::key_type> done, visited;
|
std::set<DependencyMap::key_type> done, visited;
|
||||||
std::vector<DependencyMap::key_type> newLinkLibraries;
|
std::vector<DependencyMap::key_type> newLinkLibrariesForVS6;
|
||||||
for(LinkLibraryVectorType::reverse_iterator lib =
|
for(LinkLibraryVectorType::reverse_iterator lib =
|
||||||
this->LinkLibraries.rbegin();
|
this->LinkLibrariesForVS6.rbegin();
|
||||||
lib != this->LinkLibraries.rend(); ++lib)
|
lib != this->LinkLibrariesForVS6.rend(); ++lib)
|
||||||
{
|
{
|
||||||
// skip zero size library entries, this may happen
|
// skip zero size library entries, this may happen
|
||||||
// if a variable expands to nothing.
|
// if a variable expands to nothing.
|
||||||
if (lib->first.size() != 0)
|
if (lib->first.size() != 0)
|
||||||
{
|
{
|
||||||
this->Emit( *lib, dep_map, done, visited, newLinkLibraries );
|
this->EmitForVS6( *lib, dep_map, done, visited, newLinkLibrariesForVS6 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Add the new libraries to the link line.
|
// 4. Add the new libraries to the link line.
|
||||||
//
|
//
|
||||||
for( std::vector<DependencyMap::key_type>::reverse_iterator k =
|
for( std::vector<DependencyMap::key_type>::reverse_iterator k =
|
||||||
newLinkLibraries.rbegin();
|
newLinkLibrariesForVS6.rbegin();
|
||||||
k != newLinkLibraries.rend(); ++k )
|
k != newLinkLibrariesForVS6.rend(); ++k )
|
||||||
{
|
{
|
||||||
// get the llt from the dep_map
|
// get the llt from the dep_map
|
||||||
this->LinkLibraries.push_back( std::make_pair(k->first,k->second) );
|
this->LinkLibrariesForVS6.push_back( std::make_pair(k->first,k->second) );
|
||||||
}
|
}
|
||||||
this->LinkLibrariesAnalyzed = true;
|
this->LinkLibrariesForVS6Analyzed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::InsertDependency( DependencyMap& depMap,
|
void cmTarget::InsertDependencyForVS6( DependencyMap& depMap,
|
||||||
const LibraryID& lib,
|
const LibraryID& lib,
|
||||||
const LibraryID& dep)
|
const LibraryID& dep)
|
||||||
{
|
{
|
||||||
depMap[lib].push_back(dep);
|
depMap[lib].push_back(dep);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::DeleteDependency( DependencyMap& depMap,
|
void cmTarget::DeleteDependencyForVS6( DependencyMap& depMap,
|
||||||
const LibraryID& lib,
|
const LibraryID& lib,
|
||||||
const LibraryID& dep)
|
const LibraryID& dep)
|
||||||
{
|
{
|
||||||
// Make sure there is an entry in the map for lib. If so, delete all
|
// Make sure there is an entry in the map for lib. If so, delete all
|
||||||
// dependencies to dep. There may be repeated entries because of
|
// dependencies to dep. There may be repeated entries because of
|
||||||
@ -1569,11 +1579,11 @@ void cmTarget::DeleteDependency( DependencyMap& depMap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::Emit(const LibraryID lib,
|
void cmTarget::EmitForVS6(const LibraryID lib,
|
||||||
const DependencyMap& dep_map,
|
const DependencyMap& dep_map,
|
||||||
std::set<LibraryID>& emitted,
|
std::set<LibraryID>& emitted,
|
||||||
std::set<LibraryID>& visited,
|
std::set<LibraryID>& visited,
|
||||||
DependencyList& link_line )
|
DependencyList& link_line )
|
||||||
{
|
{
|
||||||
// It's already been emitted
|
// It's already been emitted
|
||||||
if( emitted.find(lib) != emitted.end() )
|
if( emitted.find(lib) != emitted.end() )
|
||||||
@ -1619,7 +1629,7 @@ void cmTarget::Emit(const LibraryID lib,
|
|||||||
if( emitted.find(*i) == emitted.end() )
|
if( emitted.find(*i) == emitted.end() )
|
||||||
{
|
{
|
||||||
// emit dependencies
|
// emit dependencies
|
||||||
Emit( *i, dep_map, emitted, visited, link_line );
|
this->EmitForVS6( *i, dep_map, emitted, visited, link_line );
|
||||||
// emit self
|
// emit self
|
||||||
emitted.insert(*i);
|
emitted.insert(*i);
|
||||||
emitted_here.insert(*i);
|
emitted_here.insert(*i);
|
||||||
@ -1632,9 +1642,9 @@ void cmTarget::Emit(const LibraryID lib,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::GatherDependencies( const cmMakefile& mf,
|
void cmTarget::GatherDependenciesForVS6( const cmMakefile& mf,
|
||||||
const LibraryID& lib,
|
const LibraryID& lib,
|
||||||
DependencyMap& dep_map)
|
DependencyMap& dep_map)
|
||||||
{
|
{
|
||||||
// If the library is already in the dependency map, then it has
|
// If the library is already in the dependency map, then it has
|
||||||
// already been fully processed.
|
// already been fully processed.
|
||||||
@ -1678,8 +1688,8 @@ void cmTarget::GatherDependencies( const cmMakefile& mf,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
LibraryID lib2(l,llt);
|
LibraryID lib2(l,llt);
|
||||||
this->InsertDependency( dep_map, lib, lib2);
|
this->InsertDependencyForVS6( dep_map, lib, lib2);
|
||||||
this->GatherDependencies( mf, lib2, dep_map);
|
this->GatherDependenciesForVS6( mf, lib2, dep_map);
|
||||||
llt = cmTarget::GENERAL;
|
llt = cmTarget::GENERAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1687,9 +1697,10 @@ void cmTarget::GatherDependencies( const cmMakefile& mf,
|
|||||||
end = depline.find( ";", start );
|
end = depline.find( ";", start );
|
||||||
}
|
}
|
||||||
// cannot depend on itself
|
// cannot depend on itself
|
||||||
this->DeleteDependency( dep_map, lib, lib);
|
this->DeleteDependencyForVS6( dep_map, lib, lib);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static bool whiteListedInterfaceProperty(const std::string& prop)
|
static bool whiteListedInterfaceProperty(const std::string& prop)
|
||||||
|
@ -179,8 +179,6 @@ public:
|
|||||||
typedef std::pair<std::string, LinkLibraryType> LibraryID;
|
typedef std::pair<std::string, LinkLibraryType> LibraryID;
|
||||||
|
|
||||||
typedef std::vector<LibraryID > LinkLibraryVectorType;
|
typedef std::vector<LibraryID > LinkLibraryVectorType;
|
||||||
const LinkLibraryVectorType &GetLinkLibraries() const {
|
|
||||||
return this->LinkLibraries;}
|
|
||||||
const LinkLibraryVectorType &GetOriginalLinkLibraries() const
|
const LinkLibraryVectorType &GetOriginalLinkLibraries() const
|
||||||
{return this->OriginalLinkLibraries;}
|
{return this->OriginalLinkLibraries;}
|
||||||
|
|
||||||
@ -613,6 +611,11 @@ public:
|
|||||||
return this->MaxLanguageStandards;
|
return this->MaxLanguageStandards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
const LinkLibraryVectorType &GetLinkLibrariesForVS6() const {
|
||||||
|
return this->LinkLibrariesForVS6;}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool HandleLocationPropertyPolicy(cmMakefile* context) const;
|
bool HandleLocationPropertyPolicy(cmMakefile* context) const;
|
||||||
|
|
||||||
@ -622,6 +625,7 @@ private:
|
|||||||
|
|
||||||
std::vector<std::pair<TLLSignature, cmListFileBacktrace> > TLLCommands;
|
std::vector<std::pair<TLLSignature, cmListFileBacktrace> > TLLCommands;
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
/**
|
/**
|
||||||
* A list of direct dependencies. Use in conjunction with DependencyMap.
|
* A list of direct dependencies. Use in conjunction with DependencyMap.
|
||||||
*/
|
*/
|
||||||
@ -638,16 +642,16 @@ private:
|
|||||||
/**
|
/**
|
||||||
* Inserts \a dep at the end of the dependency list of \a lib.
|
* Inserts \a dep at the end of the dependency list of \a lib.
|
||||||
*/
|
*/
|
||||||
void InsertDependency( DependencyMap& depMap,
|
void InsertDependencyForVS6( DependencyMap& depMap,
|
||||||
const LibraryID& lib,
|
const LibraryID& lib,
|
||||||
const LibraryID& dep);
|
const LibraryID& dep);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Deletes \a dep from the dependency list of \a lib.
|
* Deletes \a dep from the dependency list of \a lib.
|
||||||
*/
|
*/
|
||||||
void DeleteDependency( DependencyMap& depMap,
|
void DeleteDependencyForVS6( DependencyMap& depMap,
|
||||||
const LibraryID& lib,
|
const LibraryID& lib,
|
||||||
const LibraryID& dep);
|
const LibraryID& dep);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emits the library \a lib and all its dependencies into link_line.
|
* Emits the library \a lib and all its dependencies into link_line.
|
||||||
@ -657,21 +661,22 @@ private:
|
|||||||
* link_line is in reverse order, in that the dependencies of a
|
* link_line is in reverse order, in that the dependencies of a
|
||||||
* library are listed before the library itself.
|
* library are listed before the library itself.
|
||||||
*/
|
*/
|
||||||
void Emit( const LibraryID lib,
|
void EmitForVS6( const LibraryID lib,
|
||||||
const DependencyMap& dep_map,
|
const DependencyMap& dep_map,
|
||||||
std::set<LibraryID>& emitted,
|
std::set<LibraryID>& emitted,
|
||||||
std::set<LibraryID>& visited,
|
std::set<LibraryID>& visited,
|
||||||
DependencyList& link_line);
|
DependencyList& link_line);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the dependencies for \a lib and inserts them into \a
|
* Finds the dependencies for \a lib and inserts them into \a
|
||||||
* dep_map.
|
* dep_map.
|
||||||
*/
|
*/
|
||||||
void GatherDependencies( const cmMakefile& mf,
|
void GatherDependenciesForVS6( const cmMakefile& mf,
|
||||||
const LibraryID& lib,
|
const LibraryID& lib,
|
||||||
DependencyMap& dep_map);
|
DependencyMap& dep_map);
|
||||||
|
|
||||||
void AnalyzeLibDependencies( const cmMakefile& mf );
|
void AnalyzeLibDependenciesForVS6( const cmMakefile& mf );
|
||||||
|
#endif
|
||||||
|
|
||||||
const char* GetSuffixVariableInternal(bool implib) const;
|
const char* GetSuffixVariableInternal(bool implib) const;
|
||||||
const char* GetPrefixVariableInternal(bool implib) const;
|
const char* GetPrefixVariableInternal(bool implib) const;
|
||||||
@ -720,9 +725,11 @@ private:
|
|||||||
std::vector<cmCustomCommand> PreLinkCommands;
|
std::vector<cmCustomCommand> PreLinkCommands;
|
||||||
std::vector<cmCustomCommand> PostBuildCommands;
|
std::vector<cmCustomCommand> PostBuildCommands;
|
||||||
TargetType TargetTypeValue;
|
TargetType TargetTypeValue;
|
||||||
LinkLibraryVectorType LinkLibraries;
|
|
||||||
LinkLibraryVectorType PrevLinkedLibraries;
|
LinkLibraryVectorType PrevLinkedLibraries;
|
||||||
bool LinkLibrariesAnalyzed;
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
LinkLibraryVectorType LinkLibrariesForVS6;
|
||||||
|
bool LinkLibrariesForVS6Analyzed;
|
||||||
|
#endif
|
||||||
std::vector<std::string> LinkDirectories;
|
std::vector<std::string> LinkDirectories;
|
||||||
std::set<std::string> LinkDirectoriesEmmitted;
|
std::set<std::string> LinkDirectoriesEmmitted;
|
||||||
bool HaveInstallRule;
|
bool HaveInstallRule;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user