2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-04 07:50:30 +01:00
waf/playground/strip/strip.py

33 lines
681 B
Python
Raw Normal View History

2011-09-10 11:13:51 +02:00
#! /usr/bin/env python
"""
Strip a program/library after it is created. Use this tool as an example.
Usage::
bld.program(features='strip', source='main.c', target='foo')
By using::
@TaskGen.feature('cprogram', 'cxxprogram', 'fcprogram')
It is possible to have all the C, C++ and Fortran programs stripped automatically
"""
def configure(conf):
conf.find_program('strip')
from waflib import Task, TaskGen
class strip(Task.Task):
run_str = '${STRIP} ${SRC}'
color = 'BLUE'
@TaskGen.feature('strip')
@TaskGen.after('apply_link')
def add_strip_task(self):
try:
link_task = self.link_task
except:
return
tsk = self.create_task('strip', self.link_task.outputs[0])