Chao Liu(openatom.club)
unread,Oct 21, 2025, 9:14:38 AM (2 days ago) Oct 21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to chenmiao, luo...@openatom.club, dz...@openatom.club, plu...@openatom.club, hust-os-ker...@googlegroups.com
On 10/21/2025 8:17 PM, chenmiao wrote:
> Currently, although there are only two available devices under rust/hw (one
> at each level, pl011 and hpet), I believe we should also perform operations
> similar to those in hw/char/meson.build, as shown below:
>
> system_ss.add(when: 'CONFIG_PL011_C', if_true: files('pl011.c'))
>
> Additionally, since Meson does not support directly including a subdir using
> the above syntax, I will check based on <target>-config-device.h/mak and then
> include the subdir in the compilation.
>
> Now, rust/hw can simply decide whether to build the corresponding device in a
> manner similar to the above. This is a very simple and effective approach.
>
A conditional check has been added in the meson.build file under the
path rust/hw/char/pl011:
rust_devices_ss.add(when: 'CONFIG_X_PL011_RUST', if_true: [declare_dependency(
link_whole: [_libpl011_rs],
variables: {'crate': 'pl011'},
)])
Therefore, the upper-level meson.build only needs to include the subdirectory.