[cmake-developers] Stripping import libraries under Windows ?

Alexander Neundorf neundorf at kde.org
Thu Jun 27 15:30:49 EDT 2013


Hi,

there is a bug here: http://public.kitware.com/Bug/view.php?id=14123 , which 
says that under Windows when using mingw .dll.a files should not be stripped 
during install.
A patch is also attached, which keeps import libraries from being stripped 
during install:

diff --git a/Source/cmInstallTargetGenerator.cxx 
b/Source/cmInstallTargetGenerator.cxx
index ed01210..5461252 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -717,9 +717,9 @@ cmInstallTargetGenerator::AddStripRule(std::ostream& os,
                                        const std::string& toDestDirPath)
 {
 
- //dont strip static libs, because it removes the only symbol table
+ //dont strip static and import libs,because it removes the only symbol table
   // they have so you can't link to them anymore
-  if(this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->Target->GetType() == cmTarget::STATIC_LIBRARY || this-
>ImportLibrary)
     {
     return;
     }



This looks reasonable to me, still I'd like to get some advice whether this is 
the right thing to do, also e.g. for MS compilers etc.


Thanks
Alex



More information about the cmake-developers mailing list