aux/trace: remove -I argument

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 <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37785>
This commit is contained in:
Romaric Jodin 2025-10-09 11:34:23 +02:00 committed by Marge Bot
parent aa0f404f7b
commit a25e88cd84
2 changed files with 3 additions and 12 deletions

View file

@ -108,13 +108,7 @@ def pkk_get_argparser():
type=str, type=str,
metavar="outfile", metavar="outfile",
dest="out_header", dest="out_header",
help="output C header file") help="output H header file (the basename will be use to include the header in the C source file)")
optparser.add_argument("-I",
type=str,
metavar="include",
dest="include_file",
help="include file / path used for C source output")
return optparser return optparser
@ -235,9 +229,6 @@ def pkk_output_header(fh):
def pkk_output_source(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("""\ print(textwrap.dedent("""\
/* /*
* File generated with {program}, please do not edit manually. * File generated with {program}, please do not edit manually.
@ -245,7 +236,7 @@ def pkk_output_source(fh):
#include "{include_file}" #include "{include_file}"
""").format( """).format(
program=pkk_progname, program=pkk_progname,
include_file=pkk_cfg.include_file, include_file=os.path.basename(pkk_cfg.out_header),
), file=fh) ), file=fh)
for name in lst_enum_include: for name in lst_enum_include:

View file

@ -443,7 +443,7 @@ files_libgallium += custom_target(
'tr_util.[ch]', 'tr_util.[ch]',
input: ['../include/pipe/p_defines.h', '../include/pipe/p_video_enums.h', '../../util/blend.h'], input: ['../include/pipe/p_defines.h', '../include/pipe/p_video_enums.h', '../../util/blend.h'],
output: ['tr_util.c', 'tr_util.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, depend_files: prog_enums2names,
) )