Scaninc: Don't insert missing headers into dependencies

This commit is contained in:
Marcus Huderle 2019-03-07 09:46:14 -06:00
parent 6638ebe7fd
commit bd157b301d
4 changed files with 3 additions and 17 deletions

View File

@ -1,6 +1,6 @@
#include <string.h>
#include "global.h" #include "global.h"
#include "menu.h" #include "menu.h"
#include "string.h"
#include "string_util.h" #include "string_util.h"
#include "task.h" #include "task.h"
#include "text.h" #include "text.h"

View File

@ -1,4 +1,3 @@
#include <string.h>
#include "global.h" #include "global.h"
#include "item_menu.h" #include "item_menu.h"
#include "battle.h" #include "battle.h"
@ -41,6 +40,7 @@
#include "shop.h" #include "shop.h"
#include "sound.h" #include "sound.h"
#include "sprite.h" #include "sprite.h"
#include "string.h"
#include "strings.h" #include "strings.h"
#include "string_util.h" #include "string_util.h"
#include "task.h" #include "task.h"

View File

@ -1,4 +1,3 @@
#include <string.h>
#include "global.h" #include "global.h"
#include "trainer_pokemon_sprites.h" #include "trainer_pokemon_sprites.h"
#include "bg.h" #include "bg.h"
@ -31,6 +30,7 @@
#include "scanline_effect.h" #include "scanline_effect.h"
#include "sound.h" #include "sound.h"
#include "sprite.h" #include "sprite.h"
#include "string.h"
#include "strings.h" #include "strings.h"
#include "string_util.h" #include "string_util.h"
#include "task.h" #include "task.h"

View File

@ -97,7 +97,6 @@ int main(int argc, char **argv)
} }
for (auto include : file.GetIncludes()) for (auto include : file.GetIncludes())
{ {
bool found = false;
for (auto includeDir : includeDirs) for (auto includeDir : includeDirs)
{ {
std::string path(includeDir + include); std::string path(includeDir + include);
@ -108,22 +107,9 @@ int main(int argc, char **argv)
{ {
filesToProcess.push(path); filesToProcess.push(path);
} }
found = true;
break; break;
} }
} }
if (!found)
{
if (GetFileType(include) == SourceFileType::Header)
// We don't have any generated .h files... yet.
// Better to give a warning; debugging the makefile when a
// header is missing is very difficult.
fprintf(stderr, "scaninc: warning: C header file \"%s\" not found. (included from \"%s\")\n",
include.c_str(), filePath.c_str());
// It's probably a generated file.
dependencies.insert(include);
}
} }
includeDirs.pop_back(); includeDirs.pop_back();
} }