meson only boolean options - reproducible builds

276 Views Asked by At

Fragment of meson_options.txt: option('name', type: 'boolean', value: true, description: 'Test name')

Fragment of meson.build:

conf = configuration_data()
deps = []
conf.set('NAME', get_option('name'))
if conf.get('NAME')
    deps += dependency('name')
endif

I want meson configure /tmp/ -Dname=false to skip check for dependency name, but if I do not install name-dev, meson fails with ERROR: Dependency "name" not found. In meson_options.txt are only boolean options. I want simple reproducible builds: meson .. -Dname=false -Dname2=true ... If option is false skip dependency, if option is true, and dependency is not found, fail with error.

How to achieve this?

1

There are 1 best solutions below

0
On

I executed meson twice, once: meson /tmp . and next time: meson configure /tmp -Dname=false

Error was from the first meson.