mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-26 02:14:22 +00:00
Introjucer: Slight improvement to --fix-broken-include-paths
This commit is contained in:
parent
cb1c17b9f1
commit
b3f4be1646
2 changed files with 13 additions and 6 deletions
|
|
@ -436,17 +436,24 @@ namespace
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
static File findSimilarlyNamedHeader (const Array<File>& allFiles, const String& name)
|
||||
static File findSimilarlyNamedHeader (const Array<File>& allFiles, const String& name, const File& sourceFile)
|
||||
{
|
||||
File result;
|
||||
|
||||
for (int i = 0; i < allFiles.size(); ++i)
|
||||
{
|
||||
const File& f = allFiles.getReference(i);
|
||||
|
||||
if (f.getFileName().equalsIgnoreCase (name))
|
||||
return f;
|
||||
if (f.getFileName().equalsIgnoreCase (name) && f != sourceFile)
|
||||
{
|
||||
if (result.exists())
|
||||
return File(); // multiple possible results, so don't change it!
|
||||
|
||||
result = f;
|
||||
}
|
||||
}
|
||||
|
||||
return File();
|
||||
return result;
|
||||
}
|
||||
|
||||
static void fixIncludes (const File& file, const Array<File>& allFiles)
|
||||
|
|
@ -472,7 +479,7 @@ namespace
|
|||
|
||||
if (! target.exists())
|
||||
{
|
||||
File header = findSimilarlyNamedHeader (allFiles, target.getFileName());
|
||||
File header = findSimilarlyNamedHeader (allFiles, target.getFileName(), file);
|
||||
|
||||
if (header.exists())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue