diff --git a/src/Generator/Library.cs b/src/Generator/Library.cs index 25e25785..896f58be 100644 --- a/src/Generator/Library.cs +++ b/src/Generator/Library.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text.RegularExpressions; -using CppSharp.Generators; namespace CppSharp { @@ -310,14 +309,19 @@ namespace CppSharp public static void IgnoreHeadersWithName(this Library library, string pattern) { - var modules = library.TranslationUnits.FindAll( - m => Regex.Match(m.FilePath, pattern).Success); + var units = library.TranslationUnits.FindAll(m => + { + var hasMatch = Regex.Match(m.FilePath, pattern).Success; + if (m.IncludePath != null) + hasMatch |= Regex.Match(m.IncludePath, pattern).Success; + return hasMatch; + }); - foreach (var module in modules) + foreach (var unit in units) { - module.IsGenerated = false; - module.IsProcessed = true; - module.ExplicityIgnored = true; + unit.IsGenerated = false; + unit.IsProcessed = true; + unit.ExplicityIgnored = true; } }