summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-09-03 23:44:38 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-09-03 23:52:56 +0200
commit7b0de4aa0ea6675c9c15aef34db58056a5cdfb5f (patch)
tree93a1d439666dac6f97823e9e9bd1eb6ff1a6ae92
parentfc68c9269d04d02d53628e75a8bc060aa7e7a5ca (diff)
downloadmpv-7b0de4aa0ea6675c9c15aef34db58056a5cdfb5f.tar.bz2
mpv-7b0de4aa0ea6675c9c15aef34db58056a5cdfb5f.tar.xz
build: add a check_program check
This wraps waf's find_program in our own check boilerplate code so that it can be used in the declarative dependencies section of the wscript. Can be used like this: }, { 'name': 'sed', 'desc': 'sed program', 'func': check_program('sed', 'SED'), }, { First argument is the program name, and the second is the waf variable name where the program path will be stored. In this example we will be able to refer to sed with ${{SED}} when creating waf Tasks in wscript_build. /cc @giselher: I think you need this for wayland-scanner.
-rw-r--r--waftools/checks/generic.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/waftools/checks/generic.py b/waftools/checks/generic.py
index 9f5f9d6509..e2ea78092f 100644
--- a/waftools/checks/generic.py
+++ b/waftools/checks/generic.py
@@ -6,7 +6,7 @@ from waflib import Utils
__all__ = [
"check_pkg_config", "check_cc", "check_statement", "check_libs",
"check_headers", "compose_checks", "check_true", "any_version",
- "load_fragment", "check_stub", "check_ctx_vars"]
+ "load_fragment", "check_stub", "check_ctx_vars", "check_program"]
any_version = None
@@ -29,6 +29,11 @@ def _filter_cc_arguments(ctx, opts):
opts['execute'] = False
return opts
+def check_program(name, var):
+ def fn(ctx, dependency_identifier):
+ return ctx.find_program(name, var=var, mandatory=False)
+ return fn
+
def check_libs(libs, function):
libs = [None] + libs
def fn(ctx, dependency_identifier):