Sync scaninc with pokeemerald

This commit is contained in:
GriffinR
2021-01-18 23:39:05 -05:00
parent ac62e8e563
commit cd67c5e240
3 changed files with 19 additions and 6 deletions
+13 -6
View File
@@ -97,19 +97,26 @@ int main(int argc, char **argv)
}
for (auto include : file.GetIncludes())
{
bool exists = false;
std::string path("");
for (auto includeDir : includeDirs)
{
std::string path(includeDir + include);
path = includeDir + include;
if (CanOpenFile(path))
{
bool inserted = dependencies.insert(path).second;
if (inserted)
{
filesToProcess.push(path);
}
exists = true;
break;
}
}
if (!exists && (file.FileType() == SourceFileType::Asm || file.FileType() == SourceFileType::Inc))
{
path = include;
}
bool inserted = dependencies.insert(path).second;
if (inserted && exists)
{
filesToProcess.push(path);
}
}
includeDirs.pop_back();
}