meson: evince links against dependencies even when feature was disabled
I noticed that even when passing -Denable-gspell=false
the gspell feature will be enabled if the library is present due to the following logic in meson.build
:
# *** Gspell ***
gspell_dep = dependency('gspell-1', version: '>= 1.6.0', required: get_option('gspell'))
enable_gspell = gspell_dep.found()
config_h.set10('WITH_GSPELL', enable_gspell)
If gspell was requested and the library is not found the configure will fail as expected. But if the feature was disabled but the library was found, it will be used although a build without it was explicitly requested
A possible fix would be something along the lines of
enable_gspell = get_option('gspell') and gspell_dep.found()
I guess (might be get_option('gspell').enabled()
, not sure)
Since there are multiple places with that logic I wanted to discuss how to fix it before going ahead and making a patch