Update android arch condition conversion

Only convert the architectures if they are in a stand alone form. This
means conditions such as 'if(x86 OR x86_64)', 'if(x86)', among others.

This also correctly converts statements such as 'equals(QT_ARCH,x86)'.

Change-Id: I1c3b8580ff9e4077c03a229d894d2bd3d95dba3d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2019-10-15 10:00:42 +02:00
parent 190e9dcdcf
commit 1f9d241216
1 changed files with 6 additions and 6 deletions

View File

@ -1248,12 +1248,6 @@ def map_condition(condition: str) -> str:
condition = condition.replace("*-llvm", "CLANG")
condition = condition.replace("win32-*", "WIN32")
# new conditions added by the android multi arch qmake build
condition = re.sub(r'x86[^\_]', "TEST_architecture_arch STREQUAL x86", condition)
condition = condition.replace('x86_64', "TEST_architecture_arch STREQUAL x86_64")
condition = condition.replace('arm64-v8a', "TEST_architecture_arch STREQUAL arm64")
condition = condition.replace('armeabi-v7a', "TEST_architecture_arch STREQUAL arm")
pattern = r"CONFIG\((debug|release),debug\|release\)"
match_result = re.match(pattern, condition)
if match_result:
@ -1272,6 +1266,12 @@ def map_condition(condition: str) -> str:
condition = condition.replace("&&", " AND ")
condition = condition.replace("|", " OR ")
# new conditions added by the android multi arch qmake build
condition = re.sub(r'(^| )x86([^\_]|$)', "TEST_architecture_arch STREQUAL x86", condition)
condition = re.sub(r'(^| )x86_64', " TEST_architecture_arch STREQUAL x86_64", 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)
cmake_condition = ""
for part in condition.split():
# some features contain e.g. linux, that should not be