Is there any facility (cli, online, etc) where from one meson_options.txt
file I can get all the options filled in with the defaults?
e.g.
$ meson_get_all_options
CMD -Doption=true -Doption2=42
meson setup
to create default build configurationmeson introspect --buildoptions
to dump all options in JSON formatsection=user
Example code in Lua:
-- some JSON decoder required
local json = require"json"
local projdir = "/path/to/project"
local tempdir = "/tmp/build"
assert(os.execute(string.format("meson setup %s %s >/dev/null", tempdir, projdir)))
local handle = io.popen(string.format("meson introspect %s --buildoptions", tempdir))
local data = json.decode(handle:read("*all"))
handle:close()
for i, v in ipairs(data) do
if v.section == "user" then
io.write(string.format("-D%s=%s ", v.name, v.value))
end
end
os.execute(string.format("rm -r %s", tempdir))