Skip to content

meson: Fix handling of fontconfig=disabled

Calvin Walton requested to merge kepstin/pango:fontconfig-option into main

The previous code did not support disabling fontconfig on systems where it was optional - it set required: false which is equivalent to 'auto', so fontconfig would still be used if it was found. It was also missing code to enforce the behaviour documented in meson_options.txt: "Passing 'auto' or 'disabled' disables fontconfig where it is optional"

Use the feature.disable_auto_if() function to handle disabling fontconfig by default on platforms where it's optional, and ensure that the 'disabled' feature value is preserved and passed to the dependency() and find_library() functions.

The error handling is adjusted to match the option documentation in meson_options.txt - previously, attempting to disable fontconfig on Linux would not result in an error (it would silently be enabled instead).

Edited by Calvin Walton

Merge request reports