Add more special condition conversions

Handle conversions for QT_NO_CURSOR, QT_NO_TRANSLATION and
qtConfig(opengles.).

Change-Id: Idd930f77e78f235b7997a5083ac7faf630ed9801
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2019-11-14 11:23:18 +01:00
parent ad98624f74
commit 7a6c6da2eb

View File

@ -1396,6 +1396,9 @@ def unwrap_if(input_string):
def map_condition(condition: str) -> str: def map_condition(condition: str) -> str:
# Some hardcoded cases that are too bothersome to generalize. # Some hardcoded cases that are too bothersome to generalize.
condition = re.sub(r"qtConfig\(opengles\.\)",
r"(QT_FEATURE_opengles2 OR QT_FEATURE_opengles3 OR QT_FEATURE_opengles31 OR QT_FEATURE_opengles32)",
condition)
condition = re.sub( condition = re.sub(
r"qtConfig\(opengl\(es1\|es2\)\?\)", r"qtConfig\(opengl\(es1\|es2\)\?\)",
r"QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3", r"QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3",
@ -1506,6 +1509,14 @@ def map_condition(condition: str) -> str:
condition = re.sub(r"(^| )arm64-v8a", "TEST_architecture_arch STREQUAL arm64", condition) condition = re.sub(r"(^| )arm64-v8a", "TEST_architecture_arch STREQUAL arm64", condition)
condition = re.sub(r"(^| )armeabi-v7a", "TEST_architecture_arch STREQUAL arm", condition) condition = re.sub(r"(^| )armeabi-v7a", "TEST_architecture_arch STREQUAL arm", condition)
# some defines replacements
condition = re.sub(r"DEFINES___contains___QT_NO_CURSOR",
r"(NOT QT_FEATURE_cursor)",
condition)
condition = re.sub(r"DEFINES___contains___QT_NO_TRANSLATION",
r"(NOT QT_FEATURE_translation)",
condition)
cmake_condition = "" cmake_condition = ""
for part in condition.split(): for part in condition.split():
# some features contain e.g. linux, that should not be # some features contain e.g. linux, that should not be