3
# WARNING! All changes made to this file will be lost!
6
from waflib import Utils,Build
7
from waflib.Configure import conf
8
def get_extensions(lst):
10
for x in Utils.to_list(lst):
12
if not isinstance(x,str):
14
ret.append(x[x.rfind('.')+1:])
18
def sniff_features(**kw):
19
exts=get_extensions(kw['source'])
22
if'cxx'in exts or'cpp'in exts or'c++'in exts or'cc'in exts:
24
if'c'in exts or'vala'in exts:
32
if type in['program','shlib','stlib']:
34
if x in['cxx','d','c']:
37
def set_features(kw,_type):
39
kw['features']=Utils.to_list(kw.get('features',[]))+Utils.to_list(sniff_features(**kw))
40
def program(bld,*k,**kw):
41
set_features(kw,'program')
43
def shlib(bld,*k,**kw):
44
set_features(kw,'shlib')
46
def stlib(bld,*k,**kw):
47
set_features(kw,'stlib')
49
def objects(bld,*k,**kw):
50
set_features(kw,'objects')
b'\\ No newline at end of file'