@@ -283,13 +283,15 @@ def build(
283
283
quiet = False ,
284
284
build_dir = None ,
285
285
prefix = None ,
286
+ meson_compile_args = (),
287
+ meson_install_args = (),
286
288
):
287
289
"""🔧 Build package with Meson/ninja
288
290
289
291
The package is installed to `build-install` (unless a different
290
292
build directory is specified with `-C`).
291
293
292
- MESON_ARGS are passed through e.g.:
294
+ MESON_ARGS are passed through to `meson setup` e.g.:
293
295
294
296
spin build -- -Dpkg_config_path=/lib64/pkgconfig
295
297
@@ -328,12 +330,14 @@ def build(
328
330
)
329
331
return
330
332
331
- meson_args = list (meson_args )
333
+ meson_args_setup = list (meson_args )
332
334
333
335
if gcov :
334
- meson_args = meson_args + ["-Db_coverage=true" ]
336
+ meson_args_setup = meson_args_setup + ["-Db_coverage=true" ]
335
337
336
- setup_cmd = _meson_cli () + ["setup" , build_dir , f"--prefix={ prefix } " ] + meson_args
338
+ setup_cmd = (
339
+ _meson_cli () + ["setup" , build_dir , f"--prefix={ prefix } " ] + meson_args_setup
340
+ )
337
341
338
342
if clean :
339
343
print (f"Removing `{ build_dir } `" )
@@ -365,10 +369,15 @@ def build(
365
369
compile_flags += ["-j" , str (jobs )]
366
370
367
371
p = _run (
368
- _meson_cli () + ["compile" ] + compile_flags + ["-C" , build_dir ],
372
+ _meson_cli ()
373
+ + ["compile" ]
374
+ + compile_flags
375
+ + ["-C" , build_dir ]
376
+ + list (meson_compile_args ),
369
377
sys_exit = True ,
370
378
output = not quiet ,
371
379
)
380
+
372
381
p = _run (
373
382
_meson_cli ()
374
383
+ [
@@ -380,7 +389,8 @@ def build(
380
389
install_dir
381
390
if os .path .isabs (install_dir )
382
391
else os .path .relpath (abs_install_dir , abs_build_dir ),
383
- ],
392
+ ]
393
+ + list (meson_install_args ),
384
394
output = (not quiet ) and verbose ,
385
395
)
386
396
0 commit comments