diff mbox series

[RFC,01/13] blobs: Use Meson source_set to store blob files

Message ID 20210323155132.238193-2-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series blobs: Only install required (system emulation) files | expand

Commit Message

Philippe Mathieu-Daudé March 23, 2021, 3:51 p.m. UTC
As we want to conditionally install blob files,
declare them using a source set.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 pc-bios/meson.build | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Paolo Bonzini March 23, 2021, 4:22 p.m. UTC | #1
On 23/03/21 16:51, Philippe Mathieu-Daudé wrote:
> As we want to conditionally install blob files,
> declare them using a source set.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   pc-bios/meson.build | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/pc-bios/meson.build b/pc-bios/meson.build
> index f2b32598af7..1c4074bcb0d 100644
> --- a/pc-bios/meson.build
> +++ b/pc-bios/meson.build
> @@ -1,3 +1,5 @@
> +blobs_ss = ss.source_set()
> +
>   if install_edk2_blobs
>     fds = [
>       'edk2-aarch64-code.fd',
> @@ -22,7 +24,7 @@
>     endforeach
>   endif
>   
> -blobs = files(
> +blobs_ss.add(files(
>     'bios.bin',
>     'bios-256k.bin',
>     'bios-microvm.bin',
> @@ -81,10 +83,12 @@
>     'opensbi-riscv32-generic-fw_dynamic.elf',
>     'opensbi-riscv64-generic-fw_dynamic.elf',
>     'npcm7xx_bootrom.bin',
> -)
> +))
> +
> +blobs_ss = blobs_ss.apply(config_host, strict: false)
>   
>   if get_option('install_blobs')
> -  install_data(blobs, install_dir: qemu_datadir)
> +  install_data(blobs_ss.sources(), install_dir: qemu_datadir)
>   endif
>   
>   subdir('descriptors')
> 

If you have no conditions, you can also use an array.

Paolo
diff mbox series

Patch

diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index f2b32598af7..1c4074bcb0d 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -1,3 +1,5 @@ 
+blobs_ss = ss.source_set()
+
 if install_edk2_blobs
   fds = [
     'edk2-aarch64-code.fd',
@@ -22,7 +24,7 @@ 
   endforeach
 endif
 
-blobs = files(
+blobs_ss.add(files(
   'bios.bin',
   'bios-256k.bin',
   'bios-microvm.bin',
@@ -81,10 +83,12 @@ 
   'opensbi-riscv32-generic-fw_dynamic.elf',
   'opensbi-riscv64-generic-fw_dynamic.elf',
   'npcm7xx_bootrom.bin',
-)
+))
+
+blobs_ss = blobs_ss.apply(config_host, strict: false)
 
 if get_option('install_blobs')
-  install_data(blobs, install_dir: qemu_datadir)
+  install_data(blobs_ss.sources(), install_dir: qemu_datadir)
 endif
 
 subdir('descriptors')