From a25e88cd84baac30dccfef1a873a34a38c848522 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Thu, 9 Oct 2025 11:34:23 +0200 Subject: [PATCH] aux/trace: remove -I argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enums2names.py is only uses in one place. I propose to remove the -I argument that is not strictly necessary as we can already get the header name from the `-H` argument. That modification is motivated by the need to help ninja-to-soong to generate proper rule for the Android build system. ninja-to-soong can't differenciate output file location and a string matching the output file name. Ref #14072 Acked-by: Marek Olšák Part-of: --- src/gallium/auxiliary/driver_trace/enums2names.py | 13 ++----------- src/gallium/auxiliary/meson.build | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/gallium/auxiliary/driver_trace/enums2names.py b/src/gallium/auxiliary/driver_trace/enums2names.py index f841e5601c0..885832ce6da 100755 --- a/src/gallium/auxiliary/driver_trace/enums2names.py +++ b/src/gallium/auxiliary/driver_trace/enums2names.py @@ -108,13 +108,7 @@ def pkk_get_argparser(): type=str, metavar="outfile", dest="out_header", - help="output C header file") - - optparser.add_argument("-I", - type=str, - metavar="include", - dest="include_file", - help="include file / path used for C source output") + help="output H header file (the basename will be use to include the header in the C source file)") return optparser @@ -235,9 +229,6 @@ def pkk_output_header(fh): def pkk_output_source(fh): - if pkk_cfg.include_file == None: - pkk_fatal("Output C source enabled, but include file is not set (-I option).") - print(textwrap.dedent("""\ /* * File generated with {program}, please do not edit manually. @@ -245,7 +236,7 @@ def pkk_output_source(fh): #include "{include_file}" """).format( program=pkk_progname, - include_file=pkk_cfg.include_file, + include_file=os.path.basename(pkk_cfg.out_header), ), file=fh) for name in lst_enum_include: diff --git a/src/gallium/auxiliary/meson.build b/src/gallium/auxiliary/meson.build index b1dad4fce88..1d010ba2ac0 100644 --- a/src/gallium/auxiliary/meson.build +++ b/src/gallium/auxiliary/meson.build @@ -443,7 +443,7 @@ files_libgallium += custom_target( 'tr_util.[ch]', input: ['../include/pipe/p_defines.h', '../include/pipe/p_video_enums.h', '../../util/blend.h'], output: ['tr_util.c', 'tr_util.h'], - command: [prog_python, prog_enums2names, '@INPUT@', '-C', '@OUTPUT0@', '-H', '@OUTPUT1@', '-I', 'tr_util.h'], + command: [prog_python, prog_enums2names, '@INPUT@', '-C', '@OUTPUT0@', '-H', '@OUTPUT1@'], depend_files: prog_enums2names, )