mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Core: Move generated VERSION_HASH
to a .cpp
file
This lets us have its definition in `core/version.h` and avoid rebuilding a handful of files every time the commit hash changes.
This commit is contained in:
parent
3cb9dc78d6
commit
90162851a7
13 changed files with 26 additions and 43 deletions
|
@ -111,10 +111,9 @@ def update_version(module_version_string=""):
|
|||
f.close()
|
||||
|
||||
# NOTE: It is safe to generate this file here, since this is still executed serially
|
||||
fhash = open("core/version_hash.gen.h", "w")
|
||||
fhash = open("core/version_hash.gen.cpp", "w")
|
||||
fhash.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
||||
fhash.write("#ifndef VERSION_HASH_GEN_H\n")
|
||||
fhash.write("#define VERSION_HASH_GEN_H\n")
|
||||
fhash.write('#include "core/version.h"\n')
|
||||
githash = ""
|
||||
gitfolder = ".git"
|
||||
|
||||
|
@ -132,8 +131,7 @@ def update_version(module_version_string=""):
|
|||
else:
|
||||
githash = head
|
||||
|
||||
fhash.write('#define VERSION_HASH "' + githash + '"\n')
|
||||
fhash.write("#endif // VERSION_HASH_GEN_H\n")
|
||||
fhash.write('const char *const VERSION_HASH = "' + githash + '";\n')
|
||||
fhash.close()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue