diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-01-19 02:17:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 02:17:21 -0500 |
commit | 419c897292dbfbc4f6d43880eb94597987e09e2c (patch) | |
tree | 36094eda149165d0e4dad545924b95f582d83838 /tools/scaninc/scaninc.cpp | |
parent | ac62e8e563f9e74493a394a21c1bd8fa1570b184 (diff) | |
parent | a52d6e43794e0fa773f10dcebb820bd2bca8fc40 (diff) |
Merge pull request #380 from GriffinRichards/sync-scaninc
Sync tools with pokeemerald
Diffstat (limited to 'tools/scaninc/scaninc.cpp')
-rw-r--r-- | tools/scaninc/scaninc.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index b95cbd033..dcb16c0e7 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -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(); } |