Index: mojo/public/tools/bindings/generators/mojom_cpp_generator.py |
diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py |
index 8b153a5c1d9ffc14fc4267803bd3ed010e68a0b8..4c632702d67844693eb266087b14a024106ed23f 100644 |
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py |
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py |
@@ -429,6 +429,7 @@ class Generator(generator.Generator): |
"structs": self.GetStructs(), |
"unions": self.GetUnions(), |
"interfaces": self.GetInterfaces(), |
+ "variant": self.variant, |
} |
@UseJinja("cpp_templates/module.h.tmpl", filters=cpp_filters) |
@@ -444,9 +445,10 @@ class Generator(generator.Generator): |
return self.GetJinjaExports() |
def GenerateFiles(self, args): |
+ suffix = "-%s" % self.variant if self.variant else "" |
self.Write(self.GenerateModuleHeader(), |
- self.MatchMojomFilePath("%s.h" % self.module.name)) |
+ self.MatchMojomFilePath("%s%s.h" % (self.module.name, suffix))) |
self.Write(self.GenerateModuleInternalHeader(), |
- self.MatchMojomFilePath("%s-internal.h" % self.module.name)) |
+ self.MatchMojomFilePath("%s%s-internal.h" % (self.module.name, suffix))) |
self.Write(self.GenerateModuleSource(), |
- self.MatchMojomFilePath("%s.cc" % self.module.name)) |
+ self.MatchMojomFilePath("%s%s.cc" % (self.module.name, suffix))) |