SCons: Remove run_in_subprocess dependency

This commit is contained in:
Thaddeus Crews
2024-03-11 13:05:37 -05:00
parent f040a351c2
commit 5a6e3cbcb0
22 changed files with 84 additions and 305 deletions
+5 -14
View File
@@ -1,16 +1,10 @@
"""
Functions used to generate source files during build time
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
"""
"""Functions used to generate source files during build time"""
import os
from platform_methods import subprocess_main
def make_fonts_header(target, source, env):
dst = target[0]
dst = str(target[0])
with open(dst, "w", encoding="utf-8", newline="\n") as g:
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
@@ -19,10 +13,11 @@ def make_fonts_header(target, source, env):
# Saving uncompressed, since FreeType will reference from memory pointer.
for i in range(len(source)):
with open(source[i], "rb") as f:
file = str(source[i])
with open(file, "rb") as f:
buf = f.read()
name = os.path.splitext(os.path.basename(source[i]))[0]
name = os.path.splitext(os.path.basename(file))[0]
g.write("static const int _font_" + name + "_size = " + str(len(buf)) + ";\n")
g.write("static const unsigned char _font_" + name + "[] = {\n")
@@ -32,7 +27,3 @@ def make_fonts_header(target, source, env):
g.write("};\n")
g.write("#endif")
if __name__ == "__main__":
subprocess_main(globals())