From 06d45cff0d23b0a0de9c89ad001f56fc2e335e3c Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 9 Jan 2021 11:36:19 +0900 Subject: [PATCH] [build] Keep error messages from glslangValidator The tool is horrible as a built tool due to it not being silent when all is good (it outputs the input file name) and sends its error messages to stdout instead of stderr. Then filtering causes the error code to be lost. This uses a solution found on stack-exchange. --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index b59b21eb7..c869a6f3a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -119,11 +119,11 @@ V_XXD_1 = %.spv: % @$(mkdir_p) $(builddir)/`dirname $@` - $(V_GLSLANG)$(GLSLANGVALIDATOR) -V $< -o $@ > /dev/null + $(V_GLSLANG)(((($(GLSLANGVALIDATOR) -V $< -o $@; echo $$? >&3) | sed -e '1d' 1>&2) 3>&1) | (read xs; exit $$xs)) %.spvc: % @$(mkdir_p) $(builddir)/`dirname $@` - $(V_GLSLANG)$(GLSLANGVALIDATOR) --vn `basename $< | tr . _` -V $< -o $@ > /dev/null + $(V_GLSLANG)(((($(GLSLANGVALIDATOR) --vn `basename $< | tr . _` -V $< -o $@; echo $$? >&3) | sed -e '1d' 1>&2) 3>&1) | (read xs; exit $$xs)) shaderdir = @shaderdir@ shader_DATA =