forked from mia/Aegisub
meson: don't check disabled dependencies at all
Don't search for the dependency and set up fallback only to throw it away if the option is disabled. This is a waste, and this gives the user the illusion that the request to disable the feature was ignored.
This commit is contained in:
parent
e58e4a9149
commit
18503946d5
38
meson.build
38
meson.build
|
@ -193,25 +193,27 @@ foreach dep: [
|
||||||
['hunspell', '', 'Hunspell', ['hunspell', 'hunspell_dep']],
|
['hunspell', '', 'Hunspell', ['hunspell', 'hunspell_dep']],
|
||||||
['uchardet', '', 'uchardet', ['uchardet', 'uchardet_dep']],
|
['uchardet', '', 'uchardet', ['uchardet', 'uchardet_dep']],
|
||||||
]
|
]
|
||||||
dep_version = dep[1] != '' ? dep[1] : '>=0'
|
|
||||||
# [provide] section is ignored if required is false;
|
|
||||||
# must provided define fallback explicitly
|
|
||||||
# (with meson 0.56 you can do allow_fallback: true):
|
|
||||||
#d = dependency(dep[0], version: dep_version,
|
|
||||||
# required: false, allow_fallback: true)
|
|
||||||
if dep[3].length() > 0
|
|
||||||
d = dependency(dep[0], version: dep_version, fallback: dep[3])
|
|
||||||
else
|
|
||||||
d = dependency(dep[0], version: dep_version, required: false)
|
|
||||||
endif
|
|
||||||
|
|
||||||
optname = dep[0].split('-')[0]
|
optname = dep[0].split('-')[0]
|
||||||
if d.found() and not get_option(optname).disabled()
|
if not get_option(optname).disabled()
|
||||||
deps += d
|
dep_version = dep[1] != '' ? dep[1] : '>=0'
|
||||||
conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), 1)
|
# [provide] section is ignored if required is false;
|
||||||
dep_avail += dep[2]
|
# must provided define fallback explicitly
|
||||||
elif get_option(optname).enabled()
|
# (with meson 0.56 you can do allow_fallback: true):
|
||||||
error('@0@ enabled but not found'.format(dep[2]))
|
#d = dependency(dep[0], version: dep_version,
|
||||||
|
# required: false, allow_fallback: true)
|
||||||
|
if dep[3].length() > 0
|
||||||
|
d = dependency(dep[0], version: dep_version, fallback: dep[3])
|
||||||
|
else
|
||||||
|
d = dependency(dep[0], version: dep_version, required: false)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if d.found()
|
||||||
|
deps += d
|
||||||
|
conf.set('WITH_@0@'.format(dep[0].split('-')[0].to_upper()), 1)
|
||||||
|
dep_avail += dep[2]
|
||||||
|
elif get_option(optname).enabled()
|
||||||
|
error('@0@ enabled but not found'.format(dep[2]))
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue