mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-25 11:19:52 +01:00
21 lines
517 B
Python
21 lines
517 B
Python
#! /usr/bin/env python
|
|
|
|
"""
|
|
Strip executables upon installation
|
|
"""
|
|
|
|
import shutil, os
|
|
from waflib import Build, Utils, Context
|
|
|
|
def copy_fun(self, src, tgt):
|
|
if Utils.is_win32 and len(tgt) > 259 and not tgt.startswith('\\\\?\\'):
|
|
tgt = '\\\\?\\' + tgt
|
|
shutil.copy2(src, tgt)
|
|
os.chmod(tgt, self.chmod)
|
|
|
|
if getattr(self.generator, 'link_task', None):
|
|
if self.generator.link_task.outputs[0] in self.inputs:
|
|
self.generator.bld.cmd_and_log('strip %s' % tgt, quiet=Context.BOTH)
|
|
Build.inst.copy_fun = copy_fun
|
|
|