Map module.gui to if TARGET Qt::Gui in configure.cmake

Some features check for module existence. Adapt conversion script
and QtBuild feature condition parser to handle that.

Change-Id: I063e49a6fe9f8e9cf3aec985fd78ed4430398586
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Alexandru Croitor 2019-06-04 17:34:27 +02:00
parent d0eb985f74
commit 35dc8f496d
2 changed files with 10 additions and 0 deletions

View File

@ -131,6 +131,14 @@ function(qt_evaluate_config_expression resultVar)
string(COMPARE EQUAL "${lhs}" "${rhs}" stringCompareResult) string(COMPARE EQUAL "${lhs}" "${rhs}" stringCompareResult)
list(APPEND result ${stringCompareResult}) list(APPEND result ${stringCompareResult})
elseif("${member}" STREQUAL "TARGET" AND memberIdx LESS ${length})
math(EXPR rhsIndex "${memberIdx}+1")
list(GET exists_target ${rhsIndex} rhs)
if(NOT TARGET "${exists_target}")
set(result "target_does_not_exist")
break()
endif()
set(skipNext ON)
else() else()
string(FIND "${member}" "QT_FEATURE_" idx) string(FIND "${member}" "QT_FEATURE_" idx)
if(idx EQUAL 0) if(idx EQUAL 0)

View File

@ -281,6 +281,8 @@ def map_condition(condition):
elif match.group(1) == 'config': elif match.group(1) == 'config':
substitution = map_platform(match.group(2)) substitution = map_platform(match.group(2))
elif match.group(1) == 'module':
substitution = 'TARGET {}'.format(map_qt_library(match.group(2)))
elif match.group(1) == 'arch': elif match.group(1) == 'arch':
if match.group(2) == 'i386': if match.group(2) == 'i386':