Haiku: fix adding resources

The custom_command was run in src/haiku/ and created a file with only resources inside.

Since xres edits the file in-place and meson doesn't like it, we have to run a shell script for now.
Maybe later I'll add proper support in meson.
This commit is contained in:
François Revol 2019-03-26 23:13:54 +01:00 committed by Max Kellermann
parent 095e6e6ad4
commit cde9348009
3 changed files with 16 additions and 9 deletions

View File

@ -390,6 +390,7 @@ more_deps = []
if is_android if is_android
subdir('src/java') subdir('src/java')
target_type = 'shared_library' target_type = 'shared_library'
target_name = 'mpd'
link_args += [ link_args += [
'-Wl,--no-undefined,-shared,-Bsymbolic', '-Wl,--no-undefined,-shared,-Bsymbolic',
'-llog', '-llog',
@ -401,16 +402,18 @@ if is_android
] ]
elif is_haiku elif is_haiku
target_type = 'executable' target_type = 'executable'
target_name = 'mpd.nores'
link_args += [ link_args += [
'-lnetwork', '-lnetwork',
'-lbe', '-lbe',
] ]
else else
target_type = 'executable' target_type = 'executable'
target_name = 'mpd'
endif endif
mpd = build_target( mpd = build_target(
'mpd', target_name,
sources, sources,
target_type: target_type, target_type: target_type,
include_directories: inc, include_directories: inc,
@ -449,6 +452,14 @@ endif
if is_haiku if is_haiku
subdir('src/haiku') subdir('src/haiku')
custom_target(
'mpd',
output: 'mpd',
input: [mpd, rsrc],
command: [addres, '@OUTPUT@', '@INPUT0@', '@INPUT1@'],
install: true,
install_dir: get_option('bindir'),
)
endif endif
configure_file(output: 'config.h', configuration: conf) configure_file(output: 'config.h', configuration: conf)

3
src/haiku/add_resources.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cp "$2" "$1" && xres -o "$1" -- "$3" && mimeset -f "$1" || (rm -f "$1"; exit 1)

View File

@ -8,11 +8,4 @@ rsrc = custom_target(
command: [rc, '-o', '@OUTPUT@', '@INPUT@'], command: [rc, '-o', '@OUTPUT@', '@INPUT@'],
) )
custom_target( addres = files('add_resources.sh')
'mpd.xres',
output: 'mpd',
input: [mpd, rsrc],
command: [xres, '-o', '@OUTPUT@', '--', '@INPUT@'],
install: true,
install_dir: get_option('bindir'),
)