meson: Use input/output for entitlements target
input/output parameters respect dependencies. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210709012533.58262-1-akihiko.odaki@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
d1d5e9eefd
commit
411ad8dd80
30
meson.build
30
meson.build
@ -2609,28 +2609,32 @@ foreach target : target_dirs
|
|||||||
link_args: link_args,
|
link_args: link_args,
|
||||||
gui_app: exe['gui'])
|
gui_app: exe['gui'])
|
||||||
|
|
||||||
if 'CONFIG_HVF' in config_target
|
|
||||||
entitlements = meson.current_source_dir() / 'accel/hvf/entitlements.plist'
|
|
||||||
else
|
|
||||||
entitlements = '/dev/null'
|
|
||||||
endif
|
|
||||||
if targetos == 'darwin'
|
if targetos == 'darwin'
|
||||||
icon = meson.current_source_dir() / 'pc-bios/qemu.rsrc'
|
icon = 'pc-bios/qemu.rsrc'
|
||||||
|
build_input = [emulator, files(icon)]
|
||||||
|
install_input = [
|
||||||
|
get_option('bindir') / exe_name,
|
||||||
|
meson.current_source_dir() / icon
|
||||||
|
]
|
||||||
|
if 'CONFIG_HVF' in config_target
|
||||||
|
entitlements = 'accel/hvf/entitlements.plist'
|
||||||
|
build_input += files(entitlements)
|
||||||
|
install_input += meson.current_source_dir() / entitlements
|
||||||
|
endif
|
||||||
|
|
||||||
emulators += {exe['name'] : custom_target(exe['name'],
|
emulators += {exe['name'] : custom_target(exe['name'],
|
||||||
depends: emulator,
|
input: build_input,
|
||||||
output: exe['name'],
|
output: exe['name'],
|
||||||
command: [
|
command: [
|
||||||
meson.current_source_dir() / 'scripts/entitlement.sh',
|
files('scripts/entitlement.sh'),
|
||||||
meson.current_build_dir() / exe_name,
|
'@OUTPUT@',
|
||||||
meson.current_build_dir() / exe['name'],
|
'@INPUT@'
|
||||||
entitlements, icon
|
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
meson.add_install_script('scripts/entitlement.sh', '--install',
|
meson.add_install_script('scripts/entitlement.sh', '--install',
|
||||||
get_option('bindir') / exe_name,
|
|
||||||
get_option('bindir') / exe['name'],
|
get_option('bindir') / exe['name'],
|
||||||
entitlements, icon)
|
install_input)
|
||||||
else
|
else
|
||||||
emulators += {exe['name']: emulator}
|
emulators += {exe['name']: emulator}
|
||||||
endif
|
endif
|
||||||
|
@ -8,10 +8,10 @@ if [ "$1" = --install ]; then
|
|||||||
in_place=false
|
in_place=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SRC="$1"
|
DST="$1"
|
||||||
DST="$2"
|
SRC="$2"
|
||||||
ENTITLEMENT="$3"
|
ICON="$3"
|
||||||
ICON="$4"
|
ENTITLEMENT="$4"
|
||||||
|
|
||||||
if $in_place; then
|
if $in_place; then
|
||||||
trap 'rm "$DST.tmp"' exit
|
trap 'rm "$DST.tmp"' exit
|
||||||
@ -21,7 +21,7 @@ else
|
|||||||
cd "$MESON_INSTALL_DESTDIR_PREFIX"
|
cd "$MESON_INSTALL_DESTDIR_PREFIX"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$ENTITLEMENT" != '/dev/null'; then
|
if test -n "$ENTITLEMENT"; then
|
||||||
codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
|
codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user