mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-12-23 17:55:04 +01:00
Cleanup for waf 1.7
This commit is contained in:
parent
8fb1de97d8
commit
bfca082c42
@ -581,34 +581,6 @@ class Node(object):
|
||||
|
||||
return ret
|
||||
|
||||
def find_nodes(self, find_dirs=True, find_files=True, match_fun=lambda x: True):
|
||||
# FIXME not part of the stable API: find_node vs find_nodes? consistency with argument names on other functions?
|
||||
x = """
|
||||
Recursively finds nodes::
|
||||
|
||||
def configure(cnf):
|
||||
cnf.find_nodes()
|
||||
|
||||
:param find_dirs: whether to return directories
|
||||
:param find_files: whether to return files
|
||||
:param match_fun: matching function, taking a node as parameter
|
||||
:rtype generator
|
||||
:return: a generator that iterates over all the requested files
|
||||
"""
|
||||
files = self.listdir()
|
||||
for f in files:
|
||||
node = self.make_node([f])
|
||||
if os.path.isdir(node.abspath()):
|
||||
if find_dirs and match_fun(node):
|
||||
yield node
|
||||
gen = node.find_nodes(find_dirs, find_files, match_fun)
|
||||
for g in gen:
|
||||
yield g
|
||||
else:
|
||||
if find_files and match_fun(node):
|
||||
yield node
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------
|
||||
# the following methods require the source/build folders (bld.srcnode/bld.bldnode)
|
||||
# using a subclass is a possibility, but is that really necessary?
|
||||
|
@ -586,8 +586,7 @@ def process_rule(self):
|
||||
if getattr(self, 'cwd', None):
|
||||
tsk.cwd = self.cwd
|
||||
|
||||
# TODO remove on_results in waf 1.7
|
||||
if getattr(self, 'update_outputs', None) or getattr(self, 'on_results', None):
|
||||
if getattr(self, 'update_outputs', None):
|
||||
Task.update_outputs(cls)
|
||||
|
||||
if getattr(self, 'always', None):
|
||||
|
@ -6,9 +6,9 @@
|
||||
C/C++/D configuration helpers
|
||||
"""
|
||||
|
||||
import os, imp, sys, re, shlex, shutil
|
||||
from waflib import Build, Utils, Configure, Task, Options, Logs, TaskGen, Errors, ConfigSet, Runner
|
||||
from waflib.TaskGen import before_method, after_method, feature
|
||||
import os, re, shlex, sys
|
||||
from waflib import Build, Utils, Task, Options, Logs, Errors, ConfigSet, Runner
|
||||
from waflib.TaskGen import after_method, feature
|
||||
from waflib.Configure import conf
|
||||
|
||||
WAF_CONFIG_H = 'config.h'
|
||||
@ -40,12 +40,6 @@ int main() {
|
||||
'''
|
||||
"""Code template for checking for types"""
|
||||
|
||||
SNIP_CLASS = '''
|
||||
int main() {
|
||||
if (
|
||||
}
|
||||
'''
|
||||
|
||||
SNIP_EMPTY_PROGRAM = '''
|
||||
int main() {
|
||||
return 0;
|
||||
@ -354,7 +348,7 @@ def check_cfg(self, *k, **kw):
|
||||
ret = None
|
||||
try:
|
||||
ret = self.exec_cfg(kw)
|
||||
except self.errors.WafError as e:
|
||||
except self.errors.WafError:
|
||||
if 'errmsg' in kw:
|
||||
self.end_msg(kw['errmsg'], 'YELLOW')
|
||||
if Logs.verbose > 1:
|
||||
@ -567,7 +561,6 @@ def post_check(self, *k, **kw):
|
||||
if 'define_name' in kw:
|
||||
# TODO simplify?
|
||||
if 'header_name' in kw or 'function_name' in kw or 'type_name' in kw or 'fragment' in kw:
|
||||
nm = kw['define_name']
|
||||
if kw['execute'] and kw.get('define_ret', None) and isinstance(is_success, str):
|
||||
self.define(kw['define_name'], is_success, quote=kw.get('quote', 1))
|
||||
else:
|
||||
@ -612,7 +605,7 @@ def check(self, *k, **kw):
|
||||
ret = None
|
||||
try:
|
||||
ret = self.run_c_code(*k, **kw)
|
||||
except self.errors.ConfigurationError as e:
|
||||
except self.errors.ConfigurationError:
|
||||
self.end_msg(kw['errmsg'], 'YELLOW')
|
||||
if Logs.verbose > 1:
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user