Skip to content

Commit d051d0e

Browse files
committed
meson: look up cp and dtrace with find_program()
Avoid that meson prints a "Program xyz found" test once per custom_target. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 95e2289 commit d051d0e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pc-bios/keymaps/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ if meson.is_cross_build() or 'CONFIG_XKBCOMMON' not in config_host
3838
else
3939
native_qemu_keymap = qemu_keymap
4040
endif
41+
cp = find_program('cp')
4142

4243
t = []
4344
foreach km, args: keymaps
@@ -55,7 +56,7 @@ foreach km, args: keymaps
5556
build_by_default: true,
5657
input: km,
5758
output: km,
58-
command: ['cp', '@INPUT@', '@OUTPUT@'],
59+
command: [cp, '@INPUT@', '@OUTPUT@'],
5960
install: true,
6061
install_dir: qemu_datadir / 'keymaps')
6162
endif

trace/meson.build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
specific_ss.add(files('control-target.c'))
33

44
trace_events_files = []
5+
dtrace = find_program('dtrace', required: 'CONFIG_TRACE_DTRACE' in config_host)
56
foreach dir : [ '.' ] + trace_events_subdirs
67
trace_events_file = meson.source_root() / dir / 'trace-events'
78
trace_events_files += [ trace_events_file ]
@@ -39,13 +40,13 @@ foreach dir : [ '.' ] + trace_events_subdirs
3940
trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'),
4041
output: fmt.format('trace-dtrace', 'h'),
4142
input: trace_dtrace,
42-
command: [ 'dtrace', '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ])
43+
command: [ dtrace, '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ])
4344
trace_ss.add(trace_dtrace_h)
4445
if host_machine.system() != 'darwin'
4546
trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
4647
output: fmt.format('trace-dtrace', 'o'),
4748
input: trace_dtrace,
48-
command: [ 'dtrace', '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
49+
command: [ dtrace, '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
4950
trace_ss.add(trace_dtrace_o)
5051
endif
5152

0 commit comments

Comments
 (0)