waf

FORK: waf with some random patches
git clone https://git.neptards.moe/neptards/waf.git
Log | Files | Refs | README

strip_on_install.py (517B)


      1 #! /usr/bin/env python
      2 
      3 """
      4 Strip executables upon installation
      5 """
      6 
      7 import shutil, os
      8 from waflib import Build, Utils, Context
      9 
     10 def copy_fun(self, src, tgt):
     11 	if Utils.is_win32 and len(tgt) > 259 and not tgt.startswith('\\\\?\\'):
     12 		tgt = '\\\\?\\' + tgt
     13 	shutil.copy2(src, tgt)
     14 	os.chmod(tgt, self.chmod)
     15 
     16 	if getattr(self.generator, 'link_task', None):
     17 		if self.generator.link_task.outputs[0] in self.inputs:
     18 			self.generator.bld.cmd_and_log('strip %s' % tgt, quiet=Context.BOTH)
     19 Build.inst.copy_fun = copy_fun
     20