diff options
author | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2021-04-22 21:40:54 +0300 |
---|---|---|
committer | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2021-05-21 13:47:53 +0300 |
commit | b4a876b3a1a871f43070c8756e440004c97f829a (patch) | |
tree | d177ae2eea933f3a6263cffdad81cb598bc0a5f7 | |
parent | d53068fe9146bd89aed837b344c79e4367bdb4c1 (diff) |
lib/i915/perf: have python scripts a custom_target input
That way when changing the scripts, the generated files are
regenerated.
This change makes python3 an explicit hard dependency, but that was
already the case for lib/i915/perf.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
-rw-r--r-- | lib/meson.build | 25 | ||||
-rw-r--r-- | meson.build | 4 |
2 files changed, 14 insertions, 15 deletions
diff --git a/lib/meson.build b/lib/meson.build index 9929520e..d5a1c970 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -231,47 +231,46 @@ i915_perf_hardware = [ i915_xml_files = [] foreach hw : i915_perf_hardware - i915_xml_files += 'i915/perf-configs/oa-@0@.xml'.format(hw) + i915_xml_files += files('i915/perf-configs/oa-@0@.xml'.format(hw)) endforeach i915_perf_files += custom_target( 'i915-perf-equations', - input : i915_xml_files, + input : [ 'i915/perf-configs/perf-equations-codegen.py' ] + i915_xml_files, output : [ 'i915_perf_equations.c', 'i915_perf_equations.h' ], command : [ - find_program('i915/perf-configs/perf-equations-codegen.py'), + python3, '@INPUT0@', '--code', '@OUTPUT0@', '--header', '@OUTPUT1@', - '@INPUT@', + i915_xml_files, ]) -i915_perf_register_codegen = find_program('i915/perf-configs/perf-registers-codegen.py') -i915_perf_metrics_codegen = find_program('i915/perf-configs/perf-metricset-codegen.py') - foreach hw : i915_perf_hardware i915_perf_files += custom_target( 'i915-perf-registers-@0@'.format(hw), - input : 'i915/perf-configs/oa-@0@.xml'.format(hw), + input : [ 'i915/perf-configs/perf-registers-codegen.py', + 'i915/perf-configs/oa-@0@.xml'.format(hw) ], output : [ 'i915_perf_registers_@0@.c'.format(hw), 'i915_perf_registers_@0@.h'.format(hw), ], command : [ - i915_perf_register_codegen, + python3, '@INPUT0@', '--code', '@OUTPUT0@', '--header', '@OUTPUT1@', - '--xml-file', '@INPUT@' + '--xml-file', '@INPUT1@' ]) i915_perf_files += custom_target( 'i915-perf-metrics-@0@'.format(hw), - input : 'i915/perf-configs/oa-@0@.xml'.format(hw), + input : [ 'i915/perf-configs/perf-metricset-codegen.py', + 'i915/perf-configs/oa-@0@.xml'.format(hw) ], output : [ 'i915_perf_metrics_@0@.c'.format(hw), 'i915_perf_metrics_@0@.h'.format(hw), ], command : [ - i915_perf_metrics_codegen, + python3, '@INPUT0@', '--code', '@OUTPUT0@', '--header', '@OUTPUT1@', '--equations-include', 'i915_perf_equations.h', '--registers-include', 'i915_perf_registers_@0@.h'.format(hw), - '--xml-file', '@INPUT@', + '--xml-file', '@INPUT1@', ]) endforeach diff --git a/meson.build b/meson.build index 5d9655f7..06e76189 100644 --- a/meson.build +++ b/meson.build @@ -262,6 +262,7 @@ libexecdir = join_paths(get_option('libexecdir'), 'igt-gpu-tools') amdgpudir = join_paths(libexecdir, 'amdgpu') mandir = get_option('mandir') pkgconfigdir = join_paths(libdir, 'pkgconfig') +python3 = find_program('python3', required : true) if get_option('use_rpath') # Set up runpath for the test executables towards libigt.so. @@ -316,8 +317,7 @@ subdir('overlay') subdir('man') gtk_doc = dependency('gtk-doc', required : build_docs) -python3 = find_program('python3', required : build_docs) -if build_tests and gtk_doc.found() and python3.found() +if build_tests and gtk_doc.found() subdir('docs') elif build_docs.enabled() error('Documentation requires building tests') |