SWDEV-254185 : hiprtc headers - handle empty headerIncludeNames

Change-Id: Ie06278c18b62cef1bdfbb8ac82728ed5667b2047
This commit is contained in:
agodavar
2020-10-13 01:16:59 -04:00
کامیت شده توسط Anusha Godavarthy Surya
والد c05de4f2f9
کامیت 92f1ce41dc
+9 -3
مشاهده پرونده
@@ -1617,14 +1617,20 @@ int32_t Program::build(const std::string& sourceCode, const char* origOptions,
headerIncludeNames.push_back(tmpHeaderNames[i].c_str());
}
// Compile the source code if any
if ((buildStatus_ == CL_BUILD_IN_PROGRESS) && !sourceCode.empty() &&
!compileImpl(sourceCode, headers, &headerIncludeNames[0], options)) {
bool compileStatus = true;
if ((buildStatus_ == CL_BUILD_IN_PROGRESS) && !sourceCode.empty()) {
if (!headerIncludeNames.empty()) {
compileStatus = compileImpl(sourceCode, headers, &headerIncludeNames[0], options);
} else {
compileStatus = compileImpl(sourceCode, headers, nullptr, options);
}
}
if (!compileStatus) {
buildStatus_ = CL_BUILD_ERROR;
if (buildLog_.empty()) {
buildLog_ = "Internal error: Compilation failed.";
}
}
if ((buildStatus_ == CL_BUILD_IN_PROGRESS) && !linkImpl(options)) {
buildStatus_ = CL_BUILD_ERROR;
if (buildLog_.empty()) {