SCons: Ensure written files are properly flushed/closed

Also add `core/method_bind_ext.inc` to `.gitignore`.

(cherry picked from commit ad2fb7d93b)
This commit is contained in:
Rémi Verschelde 2025-01-03 22:44:20 +01:00
parent 8ee6e3848e
commit c47810c33b
No known key found for this signature in database
GPG key ID: C3336907360768E1
8 changed files with 19 additions and 10 deletions

View file

@ -42,6 +42,7 @@ def build_shader_header( target, source, env ):
line=fs.readline()
fd.write(";\n")
fd.close()
return 0
@ -1098,6 +1099,7 @@ def update_version():
f.write("#define VERSION_MINOR "+str(version.minor)+"\n")
f.write("#define VERSION_REVISION "+str(rev)+"\n")
f.write("#define VERSION_STATUS "+str(version.status)+"\n")
f.close()
def parse_cg_file(fname, uniforms, sizes, conditionals):
@ -1167,8 +1169,8 @@ def build_cg_shader(sname):
fd.write('\t\tVP_%s,\n' % vp_uniforms[i].upper())
fd.write("\t};\n");
fd.close()
import glob
def detect_modules():
@ -1219,6 +1221,7 @@ void unregister_module_types() {
f=open("modules/register_module_types.cpp","wb")
f.write(modules_cpp)
f.close()
return module_list
@ -1323,6 +1326,7 @@ def save_active_platforms(apnames,ap):
wf = x+"/logo.h"
logow = open(wf,"wb")
logow.write(str)
logow.close()
def colored(sys,env):