优化叠加编译结构

Signed-off-by: HanSY <hansiyuan1@huawei.com>
This commit is contained in:
HanSY
2024-12-06 09:10:37 +08:00
parent f21607c496
commit 06972263b8
19 changed files with 138 additions and 207 deletions
+7 -8
View File
@@ -101,18 +101,17 @@ bool GenericCompiler::IsIgnore(const FileInfo &fileInfo)
{
std::lock_guard<std::mutex> lock(mutex_);
string output = GetOutputFilePath(fileInfo);
bool hapEmplaceSuccess = true;
bool gResEmplaceSuccess = true;
if (isHapRes_) {
hapEmplaceSuccess = g_hapResourceSet.emplace(output).second;
gResEmplaceSuccess = g_resourceSet.emplace(output).second;
} else if (g_hapResourceSet.count(output)) { // overlap the hap resource by new resource
bool resEmplaceSuccess = true;
if (hapRes_) {
g_hapResourceSet.emplace(output);
g_resourceSet.emplace(output);
} else if (g_hapResourceSet.count(output)) {
g_hapResourceSet.erase(output);
} else {
gResEmplaceSuccess = g_resourceSet.emplace(output).second;
resEmplaceSuccess = g_resourceSet.emplace(output).second;
}
if (!hapEmplaceSuccess || !gResEmplaceSuccess) {
if (!resEmplaceSuccess) {
cerr << "Warning: '" << fileInfo.filePath << "' is defined repeatedly." << endl;
return true;
}