3 import os
, sys
, shutil
, subprocess
5 global_options
= ['--werror']
10 '-Ddocumentation=true',
17 '-Db_sanitize=address',
24 '--buildtype', 'release',
33 '--buildtype', 'minsize',
34 '--default-library', 'static',
43 'arch': 'i686-w64-mingw32',
47 'arch': 'x86_64-w64-mingw32',
51 source_root
= os
.path
.abspath(os
.path
.join(os
.path
.dirname(sys
.argv
[0]) or '.', '..'))
52 output_path
= os
.path
.join(source_root
, 'output')
53 cross_path
= os
.path
.join(source_root
, 'build', 'cross')
54 prefix_root
= '/usr/local/stow'
56 for name
, data
in flavors
.items():
58 build_root
= os
.path
.join(output_path
, name
)
60 env
= os
.environ
.copy()
62 env
.update(data
['env'])
65 'meson', source_root
, build_root
,
69 cmdline
.extend(data
['options'])
71 prefix
= os
.path
.join(prefix_root
, 'libmpdclient-' + name
)
74 prefix
= os
.path
.join(prefix
, data
['arch'])
75 cmdline
+= ('--cross-file', os
.path
.join(cross_path
, name
+ '.txt'))
77 # this is necessary because Meson uses Debian's build machine
78 # MultiArch path (e.g. "lib/x86_64-linux-gnu") for cross
79 # builds, which is obviously wrong
80 cmdline
+= ('--libdir', 'lib')
82 cmdline
+= ('--prefix', prefix
)
85 shutil
.rmtree(build_root
)
89 subprocess
.check_call(cmdline
, env
=env
)