diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs index 722dc7158..d0b615f66 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs @@ -1925,16 +1925,6 @@ namespace Flax.Build.Bindings { var header = new StringBuilder(); - // Includes - CppReferencesFiles.Remove(null); - CppIncludeFilesList.Clear(); - foreach (var fileInfo in CppReferencesFiles) - CppIncludeFilesList.Add(fileInfo.Name); - CppIncludeFilesList.AddRange(CppIncludeFiles); - CppIncludeFilesList.Sort(); - foreach (var path in CppIncludeFilesList) - header.AppendFormat("#include \"{0}\"", path).AppendLine(); - // Variant converting helper methods foreach (var typeInfo in CppVariantToTypes) { @@ -2284,6 +2274,18 @@ namespace Flax.Build.Bindings } contents.Insert(headerPos, header.ToString()); + + // Includes + header.Clear(); + CppReferencesFiles.Remove(null); + CppIncludeFilesList.Clear(); + foreach (var fileInfo in CppReferencesFiles) + CppIncludeFilesList.Add(fileInfo.Name); + CppIncludeFilesList.AddRange(CppIncludeFiles); + CppIncludeFilesList.Sort(); + foreach (var path in CppIncludeFilesList) + header.AppendFormat("#include \"{0}\"", path).AppendLine(); + contents.Insert(headerPos, header.ToString()); } Utilities.WriteFileIfChanged(bindings.GeneratedCppFilePath, contents.ToString());