Detect of assembly features in bld.program()/bld.shlib()

This commit is contained in:
Thomas Nagy 2019-06-26 12:03:29 +02:00
parent 05252b85df
commit 770910fcda
2 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,7 @@ def build(bld):
source = 'main.c test.S',
target = 'asmtest',
defines = 'foo=12',
asflags = '-Os',
includes = '.')
def disp(ctx):

View File

@ -47,10 +47,12 @@ def sniff_features(**kw):
if x in exts:
feats.append('cxx')
break
if 'c' in exts or 'vala' in exts or 'gs' in exts:
feats.append('c')
if 's' in exts or 'S' in exts:
feats.append('asm')
for x in 'f f90 F F90 for FOR'.split():
if x in exts:
feats.append('fc')
@ -66,7 +68,7 @@ def sniff_features(**kw):
if typ in ('program', 'shlib', 'stlib'):
will_link = False
for x in feats:
if x in ('cxx', 'd', 'fc', 'c'):
if x in ('cxx', 'd', 'fc', 'c', 'asm'):
feats.append(x + typ)
will_link = True
if not will_link and not kw.get('features', []):