From 3a690bd07146c0b878640d9b363aa2e453a8717f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vedran=20Mileti=C4=87?= Date: Sat, 15 Aug 2015 17:14:51 +0200 Subject: [PATCH] Detect gccxml using CastXML wrapper in waf configure --- bindings/python/wscript | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bindings/python/wscript b/bindings/python/wscript index e8822d8ff..b57c5d951 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -278,11 +278,15 @@ int main () gccxml_version_line = os.popen(gccxml[0] + " --version").readline().strip() m = re.match( "^GCC-XML version (\d\.\d(\.\d)?)$", gccxml_version_line) - gccxml_version = m.group(1) - gccxml_version_ok = ([int(s) for s in gccxml_version.split('.')] >= [0, 9]) + try: + gccxml_version = m.group(1) + gccxml_version_ok = ([int(s) for s in gccxml_version.split('.')] >= [0, 9]) + except AttributeError: + gccxml_version = gccxml_version_line + gccxml_version_ok = False conf.msg('Checking for gccxml version', gccxml_version) if not gccxml_version_ok: - Logs.warn("gccxml too old, need version >= 0.9; automatic scanning of API definitions will not be possible") + Logs.warn("gccxml version unknown or too old, need version >= 0.9; automatic scanning of API definitions will not be possible") conf.report_optional_feature("pygccxml", "Python API Scanning Support", False, "gccxml too old") return