Bug 1384396 - Detect Watchman in configure; r?nalexander
It is an optional build dependency. While we detect the version, we
don't do any minimum version checking because nothing uses it... yet.
MozReview-Commit-ID: 1tPo9AnD4fV
--- a/moz.configure
+++ b/moz.configure
@@ -360,16 +360,29 @@ check_prog('GMAKE', possible_makes)
def tup_progs(build_backends):
for backend in build_backends:
if 'Tup' in backend:
return ['tup']
return None
tup = check_prog('TUP', tup_progs)
+# watchman detection
+# ==============================================================
+
+watchman = check_prog('WATCHMAN', ('watchman',), allow_missing=True)
+
+@depends_if(watchman)
+@checking('for watchman version')
+@imports('json')
+def watchman_version(watchman):
+ out = check_cmd_output(watchman, 'version')
+ res = json.loads(out)
+ return Version(res['version'])
+
# Miscellaneous programs
# ==============================================================
check_prog('DOXYGEN', ('doxygen',), allow_missing=True)
check_prog('XARGS', ('xargs',))
@depends(target)
def extra_programs(target):
if target.kernel == 'Darwin':