C++: Write IL2CPP metadata version to appdata/il2cpp-metadata-version.h

This commit is contained in:
Katy Coe
2020-09-09 17:38:05 +02:00
parent 64c7310e28
commit d81cf7fef6

View File

@@ -172,6 +172,17 @@ typedef size_t uintptr_t;
writer.Close(); writer.Close();
// Write metadata version
var versionFile = Path.Combine(srcDataPath, "il2cpp-metadata-version.h");
using var fs5 = new FileStream(versionFile, FileMode.Create);
writer = new StreamWriter(fs5, Encoding.ASCII);
writeHeader();
writeCode($"#define __IL2CPP_METADATA_VERSION {model.Package.Version * 10:F0}");
writer.Close();
// Write boilerplate code // Write boilerplate code
File.WriteAllText(Path.Combine(srcFxPath, "dllmain.cpp"), Resources.Cpp_DLLMainCpp); File.WriteAllText(Path.Combine(srcFxPath, "dllmain.cpp"), Resources.Cpp_DLLMainCpp);
File.WriteAllText(Path.Combine(srcFxPath, "helpers.cpp"), Resources.Cpp_HelpersCpp); File.WriteAllText(Path.Combine(srcFxPath, "helpers.cpp"), Resources.Cpp_HelpersCpp);