I've encountered some projects which uses meson to organize their building system. But when I want to debug their building system, I found it's difficult. The most important task is observing the building system's variable during its running. I could use message() function to show the variables of types, e.g.
integer
string
lists (of string/integer/lists)
But if the variable is dictionary type, the message() will refuse to display any information in the variable.
Does meson have a general function to display any type's variable just like python's print() function? If not, do we have any solution to do this?
Thanks in advance.
It is probably hard for the maintainers of meson to print out every object that is available in the meson.build script.
deps = []
# add some dependencies to the deps list or obtain the deps elsewhere
message('the depencies are: ')
foreach dep : deps
message(' - ', dep.name())
endforeach
For me this results in:
Message: the depencies are:
Message: - glib-2.0
Message: - gobject-2.0
Message: - gtk4
Message: - epoxy
You can't print/message a dependency, but you can print the name of the dependency :-)
You can print any object with:
message('@0@'.format(f))
Source: https://github.com/mesonbuild/meson/issues/9575#issuecomment-969053569
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With