From 6e380b88975b7b1d7bd2f5cdbe13c643f5b474cc Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 2 Apr 2020 13:49:59 +0200 Subject: [PATCH] cgen: brin back hashes() --- vlib/v/gen/cgen.v | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 7d7274c732..65d5a509f8 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -8,6 +8,7 @@ import ( v.token v.pref term + v.util ) const ( @@ -98,6 +99,13 @@ pub fn cgen(files []ast.File, table &table.Table, pref &pref.Preferences) string if g.is_test { g.write_tests_main() } + return g.hashes() + g.typedefs.str() + g.definitions.str() + g.out.str() +} + +pub fn (g &Gen) hashes() string { + mut res := c_commit_hash_default.replace('@@@', util.vhash() ) + res += c_current_commit_hash_default.replace('@@@', util.githash( g.pref.building_v ) ) + return res return c_commit_hash_default + g.typedefs.str() + g.definitions.str() + g.out.str() }