Skip to content

Commit 998f38c

Browse files
authored
Print compile/link logs to stderr (KhronosGroup#4138)
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 168d452 commit 998f38c

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
@@ -1523,9 +1523,9 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
15231523
if (! (Options & EOptionSuppressInfolog) &&
15241524
! (Options & EOptionMemoryLeakMode)) {
15251525
if (!beQuiet)
1526-
PutsIfNonEmpty(compUnit.fileName[0].c_str());
1527-
PutsIfNonEmpty(shader->getInfoLog());
1528-
PutsIfNonEmpty(shader->getInfoDebugLog());
1526+
StderrIfNonEmpty(compUnit.fileName[0].c_str());
1527+
StderrIfNonEmpty(shader->getInfoLog());
1528+
StderrIfNonEmpty(shader->getInfoDebugLog());
15291529
}
15301530
}
15311531

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

15471547
// Report
15481548
if (!(Options & EOptionSuppressInfolog) && !(Options & EOptionMemoryLeakMode)) {
1549-
PutsIfNonEmpty(program.getInfoLog());
1550-
PutsIfNonEmpty(program.getInfoDebugLog());
1549+
StderrIfNonEmpty(program.getInfoLog());
1550+
StderrIfNonEmpty(program.getInfoDebugLog());
15511551
}
15521552

15531553
// Reflect

Test/runtests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [ -d "${LIBPATH}" ]; then
1717
fi
1818

1919
function run {
20-
"$EXE" "$@"
20+
"$EXE" "$@" 2>&1
2121
result=$?
2222
case "$result" in
2323
[0-6]) # Valid success and error codes

0 commit comments

Comments
 (0)