| 861 | } |
| 862 | |
| 863 | void cmInstallTargetGenerator::AddStripRule(std::ostream& os, Indent indent, |
| 864 | std::string const& toDestDirPath) |
| 865 | { |
| 866 | |
| 867 | // don't strip static and import libraries, because it removes the only |
| 868 | // symbol table they have so you can't link to them anymore |
| 869 | if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY || |
| 870 | this->ImportLibrary || this->NamelinkMode == NamelinkModeOnly) { |
| 871 | return; |
| 872 | } |
| 873 | |
| 874 | // Don't handle OSX Bundles. |
| 875 | if (this->Target->IsApple() && |
| 876 | this->Target->GetPropertyAsBool("MACOSX_BUNDLE")) { |
| 877 | return; |
| 878 | } |
| 879 | |
| 880 | std::string const& strip = |
| 881 | this->Target->Target->GetMakefile()->GetSafeDefinition("CMAKE_STRIP"); |
| 882 | if (strip.empty()) { |
| 883 | return; |
| 884 | } |
| 885 | |
| 886 | std::string stripArgs; |
| 887 | if (this->Target->IsApple()) { |
| 888 | if (this->Target->GetType() == cmStateEnums::SHARED_LIBRARY || |
| 889 | this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) { |
| 890 | // Strip tools need '-x' to strip Apple dylibs correctly. |
| 891 | stripArgs = "-x "; |
| 892 | } else if (this->Target->GetType() == cmStateEnums::EXECUTABLE && |
| 893 | this->Target->GetGlobalGenerator()->GetStripCommandStyle( |
| 894 | strip) == cmGlobalGenerator::StripCommandStyle::Apple) { |
| 895 | // Apple's strip tool needs '-u -r' to strip executables correctly. |
| 896 | stripArgs = "-u -r "; |
| 897 | } |
| 898 | } |
| 899 | |
| 900 | os << indent << "if(CMAKE_INSTALL_DO_STRIP)\n"; |
| 901 | os << indent << " execute_process(COMMAND \"" << strip << "\" " << stripArgs |
| 902 | << "\"" << toDestDirPath << "\")\n"; |
| 903 | os << indent << "endif()\n"; |
| 904 | } |
| 905 | |
| 906 | void cmInstallTargetGenerator::AddRanlibRule(std::ostream& os, Indent indent, |
| 907 | std::string const& toDestDirPath) |
no test coverage detected