SCons: Remove run_in_subprocess dependency
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user