@ -330,7 +330,7 @@ namespace AZ
// Pump one last time to make sure the streams have been flushed
pumpOuputStreams ( ) ;
const bool reportedErrors = Report Error Messages( toolNameForLog , errorMessages ) ;
const bool reportedErrors = Report Messages( toolNameForLog , errorMessages , exitCode ! = 0 ) ;
if ( timedOut )
{
@ -367,32 +367,20 @@ namespace AZ
return true ;
}
bool Report Error Messages( [[maybe_unused]] AZStd : : string_view window , AZStd : : string_view errorMessage s)
bool Report Messages( [[maybe_unused]] AZStd : : string_view window , AZStd : : string_view errorMessage s, bool reportAsError s)
{
// There are more efficient ways to do this, but this approach is simple and gets us moving for now.
AZStd : : vector < AZStd : : string > lines ;
AzFramework : : StringFunc : : Tokenize ( errorMessages . data ( ) , lines , " \n \r " ) ;
bool foundErrors = false ;
for ( auto & line : lines )
if ( reportAsErrors )
{
if ( AZStd : : string : : npos ! = AzFramework : : StringFunc : : Find ( line , " error " ) )
{
AZ_Error ( window . data ( ) , false , " %s " , line . data ( ) ) ;
foundErrors = true ;
}
else if ( AZStd : : string : : npos ! = AzFramework : : StringFunc : : Find ( line , " warning " ) )
{
AZ_Warning ( window . data ( ) , false , " %s " , line . data ( ) ) ;
}
else
{
AZ_TracePrintf ( window . data ( ) , " %s " , line . data ( ) ) ;
}
AZ_Error ( window . data ( ) , false , " %.*s " , aznumeric_cast < int > ( errorMessages . size ( ) ) , errorMessages . data ( ) ) ;
}
return foundErrors ;
else
{
// Using AZ_Warning instead of AZ_TracePrintf because this function is commonly
// used to report messages from stderr when executing applications. Applications
// when ran successfully, only output to stderr for errors or warnings.
AZ_Warning ( window . data ( ) , false , " %.*s " , aznumeric_cast < int > ( errorMessages . size ( ) ) , errorMessages . data ( ) ) ;
}
return AZStd : : string : : npos ! = AzFramework : : StringFunc : : Find ( errorMessages , " error " ) ;
}
ShaderStage ToRHIShaderStage ( ShaderHardwareStage stageType )