Skip to content

Commit df48165

Browse files
committed
Print compile/link logs to stderr
When glslang is integrated into a build system (like Meson), stdout is stored in an output file and stderr is printed to the user. This hides error messages from the user. See: mesonbuild/meson#11506 stderr is the standard stream errors should get printed to, always use that.
1 parent 1399733 commit df48165

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

StandAlone/StandAlone.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,9 +1506,9 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
15061506
if (! (Options & EOptionSuppressInfolog) &&
15071507
! (Options & EOptionMemoryLeakMode)) {
15081508
if (!beQuiet)
1509-
PutsIfNonEmpty(compUnit.fileName[0].c_str());
1510-
PutsIfNonEmpty(shader->getInfoLog());
1511-
PutsIfNonEmpty(shader->getInfoDebugLog());
1509+
StderrIfNonEmpty(compUnit.fileName[0].c_str());
1510+
StderrIfNonEmpty(shader->getInfoLog());
1511+
StderrIfNonEmpty(shader->getInfoDebugLog());
15121512
}
15131513
}
15141514

@@ -1529,8 +1529,8 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
15291529

15301530
// Report
15311531
if (!(Options & EOptionSuppressInfolog) && !(Options & EOptionMemoryLeakMode)) {
1532-
PutsIfNonEmpty(program.getInfoLog());
1533-
PutsIfNonEmpty(program.getInfoDebugLog());
1532+
StderrIfNonEmpty(program.getInfoLog());
1533+
StderrIfNonEmpty(program.getInfoDebugLog());
15341534
}
15351535

15361536
// Reflect

Test/runtests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if [ -a localtestlist ]
3333
while read t; do
3434
echo Running $t...
3535
b=`basename $t`
36-
run -i -l $t > "$TARGETDIR/$b.out"
36+
run -i -l $t > "$TARGETDIR/$b.out" 2>&1
3737
diff -b $BASEDIR/$b.out "$TARGETDIR/$b.out" || HASERROR=1
3838
done < localtestlist
3939
fi

0 commit comments

Comments
 (0)