glsl: When failing to compile some builtins, print the error.
authorEric Anholt <eric@anholt.net>
Mon, 12 Mar 2012 22:47:06 +0000 (15:47 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 15 Mar 2012 23:24:50 +0000 (16:24 -0700)
This makes the process slightly more debuggable, though it would be
nice if the build just failed immediately instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/builtins/tools/generate_builtins.py

index 72d12bb2a9a4fb6142ffb78db67f542ae91dbcc4..9ab6edd226f68047b5b6c4a5f1b615c77d73f5b5 100755 (executable)
@@ -63,6 +63,14 @@ def run_compiler(args):
     p = Popen(command, 1, stdout=PIPE, shell=False)
     output = p.communicate()[0]
 
+    if (p.returncode):
+        sys.stderr.write("Failed to compile builtins with command:\n")
+        for arg in command:
+            sys.stderr.write(arg + " ")
+        sys.stderr.write("\n")
+        sys.stderr.write("Result:\n")
+        sys.stderr.write(output)
+
     # Clean up output a bit by killing whitespace before a closing paren.
     kill_paren_whitespace = re.compile(r'[ \n]*\)', re.MULTILINE)
     output = kill_paren_whitespace.sub(')', output)