util/glsl2spirv: don't store preprocessed files in source tree

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19893>
This commit is contained in:
Lionel Landwerlin 2022-11-21 00:00:22 +02:00 committed by Marge Bot
parent 1b492d5031
commit 5ebf72c44c
1 changed files with 4 additions and 3 deletions

View File

@ -125,8 +125,8 @@ def postprocess_file(args: Arguments) -> None:
w.writelines(lines)
def preprocess_file(args: Arguments, origin_file: T.TextIO) -> str:
with open(origin_file.name + ".copy", "w") as copy_file:
def preprocess_file(args: Arguments, origin_file: T.TextIO, directory: os.PathLike) -> str:
with open(os.path.join(directory, os.path.basename(origin_file.name)), "w") as copy_file:
lines = origin_file.readlines()
if args.create_entry is not None:
@ -142,7 +142,8 @@ def preprocess_file(args: Arguments, origin_file: T.TextIO) -> str:
def process_file(args: Arguments) -> None:
with open(args.input, "r") as infile:
copy_file = preprocess_file(args, infile)
copy_file = preprocess_file(args, infile,
os.path.dirname(args.output))
cmd_list = [args.glslang]