2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00

Update the strip example

This commit is contained in:
Thomas Nagy 2016-08-13 18:21:08 +02:00
parent 07c153c220
commit 52add352d4
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
3 changed files with 19 additions and 8 deletions

4
playground/strip/a.c Normal file
View File

@ -0,0 +1,4 @@
int foo() {
return 23;
}

View File

@ -7,12 +7,8 @@ Usage::
bld.program(features='strip', source='main.c', target='foo')
By using::
@TaskGen.feature('cprogram', 'cxxprogram', 'fcprogram')
If stripping at installation time is preferred, use the following::
If stripping at installation time is preferred, override/modify the method
copy_fun on the installation context::
import shutil, os
from waflib import Build
@ -37,7 +33,6 @@ from waflib import Task, TaskGen
class strip(Task.Task):
run_str = '${STRIP} ${SRC}'
color = 'BLUE'
after = ['cprogram', 'cxxprogram', 'cshlib', 'cxxshlib', 'fcprogram', 'fcshlib']
before = ['inst']
@TaskGen.feature('strip')
@ -48,3 +43,14 @@ def add_strip_task(self):
except AttributeError:
return
self.create_task('strip', link_task.outputs[0])
@TaskGen.feature('cshlib', 'cxxshlib', 'cprogram', 'cxxprogram', 'fcprogram', 'fcshlib')
@TaskGen.after('process_use', 'apply_link')
def set_strip_order(self):
# as an example
if getattr(self, 'link_task', None):
for x in self.tmp_use_seen:
tg = self.bld.get_tgen_by_name(x)
if getattr(tg, 'link_task', None):
self.link_task.set_run_after(tg.link_task)

View File

@ -8,5 +8,6 @@ def configure(conf):
conf.load('strip', tooldir='.')
def build(bld):
bld.program(features='strip', source='main.c', target='app')
bld.shlib(features='strip', source='a.c', target='lib1')
bld.program(features='strip', source='main.c', target='app', use='lib1')