mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
Node objects can be folders too, but dependencies must be managed manually
This commit is contained in:
parent
6768a4cb38
commit
3cac9c7077
@ -23,8 +23,12 @@ def build(bld):
|
||||
|
||||
#print( 'path from srcnode', bld.path.find_or_declare('aaa').path_from(bld.bldnode) )
|
||||
|
||||
bld.install_files('/tmp/bar', 'wscript')
|
||||
# folders as nodes are best avoided
|
||||
dnode = bld.path.get_bld().make_node('testdir')
|
||||
bld(rule='mkdir -p ${TGT}', target=dnode)
|
||||
bld(rule='touch ${TGT}', source=dnode, target=dnode.make_node('stuff'), cls_str=lambda x: 'stuff')
|
||||
|
||||
bld.install_files('/tmp/bar', 'wscript')
|
||||
bld(features='c cprogram', source='main.c', target='app')
|
||||
|
||||
|
||||
|
@ -823,7 +823,16 @@ class Node(object):
|
||||
try:
|
||||
ret = cache[self]
|
||||
except KeyError:
|
||||
ret = cache[self] = Utils.h_file(self.abspath())
|
||||
p = self.abspath()
|
||||
try:
|
||||
ret = cache[self] = Utils.h_file(p)
|
||||
except EnvironmentError:
|
||||
if os.path.isdir(p):
|
||||
# allow folders as build nodes, do not use the creation time
|
||||
st = os.stat(p)
|
||||
ret = cache[self] = Utils.h_list([p, st.st_ino, st.st_mode])
|
||||
return ret
|
||||
raise
|
||||
return ret
|
||||
|
||||
# --------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user