Fix for '-q' option in ocloc

Related-To: NEO-6425
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
This commit is contained in:
Warchulski, Jaroslaw
2022-11-10 13:10:24 +00:00
committed by Compute-Runtime-Automation
parent 0a07ea94c7
commit e9f0cb30e7
2 changed files with 44 additions and 5 deletions

View File

@@ -416,11 +416,14 @@ int OfflineCompiler::build() {
void OfflineCompiler::updateBuildLog(const char *pErrorString, const size_t errorStringSize) {
std::string errorString = (errorStringSize && pErrorString) ? std::string(pErrorString, pErrorString + errorStringSize) : "";
if (errorString[0] != '\0') {
if (buildLog.empty()) {
buildLog.assign(errorString.c_str());
} else {
buildLog.append("\n");
buildLog.append(errorString.c_str());
bool errorFound = (errorString.find("Error") != std::string::npos) || (errorString.find("error") != std::string::npos);
if (!isQuiet() || errorFound) {
if (buildLog.empty()) {
buildLog.assign(errorString.c_str());
} else {
buildLog.append("\n");
buildLog.append(errorString.c_str());
}
}
}
}