Make -pkg-config configure option actually work

The QtBuildInternals config package file gets processed before feature
evaluation occurs. That means INPUT_pkg_config may be defined, but the
corresponding FEATURE_pkg_config variable won't have been set/updated
yet. Do this check locally because the availability of a number of
features is conditional on whether pkg-config is available.

Change-Id: I6030eb380ee0c630ffbe5db5eed397a46227c7f6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Craig Scott 2021-01-14 15:12:06 +11:00
parent b101f84f86
commit f283f06216

View File

@ -75,6 +75,12 @@ function(qt_build_internals_disable_pkg_config_if_needed)
set(pkg_config_enabled OFF)
endif()
# Features won't have been evaluated yet if this is the first run, have to evaluate this here
if(NOT "${FEATURE_pkg_config}" AND "${INPUT_pkg_config}"
AND NOT "${INPUT_pkg_config}" STREQUAL "undefined")
set(FEATURE_pkg_config ON)
endif()
# If user explicitly specified a value for the feature, honor it, even if it might break
# the build.
if(DEFINED FEATURE_pkg_config)