diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-05-02 19:10:19 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-05-02 19:10:19 (GMT) |
commit | 2242006ca1f6834059d23b761dafd4ad7e70661b (patch) | |
tree | 25234eab987916695cbe4202d2548b8c61def63e /Source/cmTarget.cxx | |
parent | 4fe8947bcc725396a6bb85720c6836d81d100dd7 (diff) | |
download | CMake-2242006ca1f6834059d23b761dafd4ad7e70661b.zip CMake-2242006ca1f6834059d23b761dafd4ad7e70661b.tar.gz CMake-2242006ca1f6834059d23b761dafd4ad7e70661b.tar.bz2 |
Debug optimized cache fixes
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 59900da..7d3dda7 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -80,6 +80,25 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, { m_LinkLibraries.push_back( std::pair<std::string, cmTarget::LinkLibraryType>(lib,llt) ); + if(llt != cmTarget::GENERAL) + { + std::string linkTypeName = this->CanonicalLibraryName(lib); + linkTypeName += "_LINK_TYPE"; + switch(llt) + { + case cmTarget::DEBUG: + mf.AddCacheDefinition(linkTypeName.c_str(), + "debug", "Library is used for debug links only", + cmCacheManager::INTERNAL); + break; + case cmTarget::OPTIMIZED: + mf.AddCacheDefinition(linkTypeName.c_str(), + "optimized", "Library is used for debug links only", + cmCacheManager::INTERNAL); + break; + } + } + mf.AddDependencyToCache( target, lib ); } @@ -127,7 +146,7 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf ) // if a variable expands to nothing. if (lib->first.size() == 0) continue; - std::string cname = CanonicalLibraryName(lib->first); + std::string cname = this->CanonicalLibraryName(lib->first); lib_order.push_back( cname ); if( lib_map.end() == lib_map.find( cname ) ) { @@ -140,7 +159,7 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf ) // have specified them for( LinkLine::iterator i = orig_libs.begin(); i != orig_libs.end(); ++i ) { - GatherDependencies( mf, *i, dep_map, lib_map ); + this->GatherDependencies( mf, *i, dep_map, lib_map ); } // For the rest, get implicit dependencies. A library x depends @@ -193,7 +212,6 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf ) // for all the new libraries added by the dependency analysis. const char* libOutPath = mf.GetDefinition("LIBRARY_OUTPUT_PATH"); bool addLibDirs = (libOutPath==0 || strcmp(libOutPath,"")==0); - m_LinkLibraries.clear(); for( std::vector<std::string>::reverse_iterator i = link_line.rbegin(); i != link_line.rend(); ++i ) @@ -217,7 +235,22 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf ) } } } - m_LinkLibraries.push_back( std::make_pair(*i,GENERAL) ); + std::string linkType = *i; + linkType += "_LINK_TYPE"; + cmTarget::LinkLibraryType llt = cmTarget::GENERAL; + const char* linkTypeString = mf.GetDefinition( linkType.c_str() ); + if(linkTypeString) + { + if(strcmp(linkTypeString, "debug") == 0) + { + llt = cmTarget::DEBUG; + } + if(strcmp(linkTypeString, "optimized") == 0) + { + llt = cmTarget::OPTIMIZED; + } + } + m_LinkLibraries.push_back( std::make_pair(*i,llt) ); } else { @@ -247,10 +280,10 @@ std::string cmTarget::CanonicalLibraryName( const std::string& lib ) const { return libname_noprefix.match(1); } - else - { - return file; - } + else + { + return file; + } } else { |