-
I am beginner to meson build, In QEMU, there are many code similar to this for conditional compilation
But how can I check if What I tried:
None of the above works, error during meson configure The doc of source_set says
I am very confused that how I guess the string is a key to a dictionary? But how to get the dictionary? The exact QEMU commit I use is XUANTIE-RV/qemu@fd25f40 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Those values are resolved when The basic opration is something like this: conf = configuration_data()
conf.set('FOO_TRUE', true)
conf.set('FOO_FALSE', false)
s = source_set()
s.add(when : 'FOO_TRUE', files: files('true.c'))
s.add(when : 'FOO_FALSE', files : files('false.c'))
sources = s.apply(conf).sources()
assert(sources == files('true.c') So if you want to change that into a conditional inline, you need to have whichever conf = configuration_data()
conf.set('FOO_TRUE', true)
conf.set('FOO_FALSE', false)
if conf.get('FOO_TRUE')
...
endif |
Beta Was this translation helpful? Give feedback.
Those values are resolved when
source_set.apply()
is called, but are stored as strings until that time.The basic opration is something like this:
So if you want to change that into a conditional inline, you need to have whichever
configuration_data
that will be passed to apply: