diff options
| author | GriffinR <griffin.g.richards@gmail.com> | 2019-09-03 22:22:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-03 22:22:14 -0400 |
| commit | 6b04ea0727973e66227b31caa2ccdcb6f2b4891f (patch) | |
| tree | 4d5e4e5d1b6e480bd195d8a9a29703e6475cc2e9 /tools/scaninc | |
| parent | ecf2097abb1481109578b7b8260fd40606f27abe (diff) | |
| parent | 1f4c88c95243e8d75f25d5b7868c837c47aa578d (diff) | |
Merge branch 'master' into document-eventscripts
Diffstat (limited to 'tools/scaninc')
| -rw-r--r-- | tools/scaninc/scaninc.cpp | 19 | ||||
| -rw-r--r-- | tools/scaninc/source_file.cpp | 5 | ||||
| -rw-r--r-- | tools/scaninc/source_file.h | 1 |
3 files changed, 19 insertions, 6 deletions
diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index b95cbd033..a3e40c5d9 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) + { + path = include; + } + bool inserted = dependencies.insert(path).second; + if (inserted && exists) + { + filesToProcess.push(path); + } } includeDirs.pop_back(); } diff --git a/tools/scaninc/source_file.cpp b/tools/scaninc/source_file.cpp index f23ff6db6..df31282f8 100644 --- a/tools/scaninc/source_file.cpp +++ b/tools/scaninc/source_file.cpp @@ -89,6 +89,11 @@ SourceFile::SourceFile(std::string path) } } +SourceFileType SourceFile::FileType() +{ + return m_file_type; +} + SourceFile::~SourceFile() { if (m_file_type == SourceFileType::Cpp || m_file_type == SourceFileType::Header) diff --git a/tools/scaninc/source_file.h b/tools/scaninc/source_file.h index f7b6412bd..854b3f116 100644 --- a/tools/scaninc/source_file.h +++ b/tools/scaninc/source_file.h @@ -50,6 +50,7 @@ public: const std::set<std::string>& GetIncbins(); const std::set<std::string>& GetIncludes(); std::string& GetSrcDir(); + SourceFileType FileType(); private: union InnerUnion { |
