diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-06-15 13:00:54 -0400 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-06-15 13:00:54 -0400 |
commit | 82375189948c5740d57415c305534500984fc14f (patch) | |
tree | 2ac4574b7cf7405d772513656f0b31304777c840 /Source/cmInstallTargetGenerator.cxx | |
parent | 69d362846161e14002377a66e7505219b2b6af27 (diff) | |
download | cmake-82375189948c5740d57415c305534500984fc14f.tar.gz |
BUG: don't strip static libraries, it removes their symbol table, dynamic
libs have an extra symbol table so they still work stripped
Alex
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index c38bcc7abd..1205f5c421 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -182,10 +182,10 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) quotedFullDestinationFilename += "/"; quotedFullDestinationFilename += cmSystemTools::GetFilenameName(fromFile); quotedFullDestinationFilename += "\""; - + this->AddRanlibRule(os, type, quotedFullDestinationFilename); - this->AddStripRule(os, quotedFullDestinationFilename, optional); + this->AddStripRule(os, type, quotedFullDestinationFilename, optional); } //---------------------------------------------------------------------------- @@ -453,10 +453,18 @@ void cmInstallTargetGenerator } void cmInstallTargetGenerator::AddStripRule(std::ostream& os, + cmTarget::TargetType type, const std::string& quotedFullDestinationFilename, bool optional) { + // don't strip static libraries, because it removes the only symbol table + // they have so you can't link to them anymore + if(type == cmTarget::STATIC_LIBRARY) + { + return; + } + // Don't handle OSX Bundles. if(this->Target->GetMakefile()->IsOn("APPLE") && this->Target->GetPropertyAsBool("MACOSX_BUNDLE")) @@ -469,21 +477,18 @@ void cmInstallTargetGenerator::AddStripRule(std::ostream& os, return; } - os << "IF(CMAKE_INSTALL_DO_STRIP"; + std::string optionalString; if (optional) { - os << " AND EXISTS " << quotedFullDestinationFilename; + optionalString = " AND EXISTS "; + optionalString += quotedFullDestinationFilename; } - os << ")\n"; + + os << "IF(CMAKE_INSTALL_DO_STRIP" << optionalString << ")\n"; os << " EXECUTE_PROCESS(COMMAND \"" << this->Target->GetMakefile()->GetDefinition("CMAKE_STRIP") << "\" " << quotedFullDestinationFilename << " )\n"; - os << "ENDIF(CMAKE_INSTALL_DO_STRIP"; - if (optional) - { - os << " AND EXISTS " << quotedFullDestinationFilename; - } - os << ")\n"; + os << "ENDIF(CMAKE_INSTALL_DO_STRIP" << optionalString << ")\n"; } void cmInstallTargetGenerator::AddRanlibRule(std::ostream& os, |