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 <pbonzini@redhat.com>
This commit is contained in:
parent
95e2289fda
commit
d051d0e14c
@ -38,6 +38,7 @@ if meson.is_cross_build() or 'CONFIG_XKBCOMMON' not in config_host
|
|||||||
else
|
else
|
||||||
native_qemu_keymap = qemu_keymap
|
native_qemu_keymap = qemu_keymap
|
||||||
endif
|
endif
|
||||||
|
cp = find_program('cp')
|
||||||
|
|
||||||
t = []
|
t = []
|
||||||
foreach km, args: keymaps
|
foreach km, args: keymaps
|
||||||
@ -55,7 +56,7 @@ foreach km, args: keymaps
|
|||||||
build_by_default: true,
|
build_by_default: true,
|
||||||
input: km,
|
input: km,
|
||||||
output: km,
|
output: km,
|
||||||
command: ['cp', '@INPUT@', '@OUTPUT@'],
|
command: [cp, '@INPUT@', '@OUTPUT@'],
|
||||||
install: true,
|
install: true,
|
||||||
install_dir: qemu_datadir / 'keymaps')
|
install_dir: qemu_datadir / 'keymaps')
|
||||||
endif
|
endif
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
specific_ss.add(files('control-target.c'))
|
specific_ss.add(files('control-target.c'))
|
||||||
|
|
||||||
trace_events_files = []
|
trace_events_files = []
|
||||||
|
dtrace = find_program('dtrace', required: 'CONFIG_TRACE_DTRACE' in config_host)
|
||||||
foreach dir : [ '.' ] + trace_events_subdirs
|
foreach dir : [ '.' ] + trace_events_subdirs
|
||||||
trace_events_file = meson.source_root() / dir / 'trace-events'
|
trace_events_file = meson.source_root() / dir / 'trace-events'
|
||||||
trace_events_files += [ trace_events_file ]
|
trace_events_files += [ trace_events_file ]
|
||||||
@ -39,13 +40,13 @@ foreach dir : [ '.' ] + trace_events_subdirs
|
|||||||
trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'),
|
trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'),
|
||||||
output: fmt.format('trace-dtrace', 'h'),
|
output: fmt.format('trace-dtrace', 'h'),
|
||||||
input: trace_dtrace,
|
input: trace_dtrace,
|
||||||
command: [ 'dtrace', '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ])
|
command: [ dtrace, '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ])
|
||||||
trace_ss.add(trace_dtrace_h)
|
trace_ss.add(trace_dtrace_h)
|
||||||
if host_machine.system() != 'darwin'
|
if host_machine.system() != 'darwin'
|
||||||
trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
|
trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
|
||||||
output: fmt.format('trace-dtrace', 'o'),
|
output: fmt.format('trace-dtrace', 'o'),
|
||||||
input: trace_dtrace,
|
input: trace_dtrace,
|
||||||
command: [ 'dtrace', '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
|
command: [ dtrace, '-DSTAP_SDT_V2', '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
|
||||||
trace_ss.add(trace_dtrace_o)
|
trace_ss.add(trace_dtrace_o)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user