From 1f9d2412163282b46135a08244268e84c430d7c6 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Tue, 15 Oct 2019 10:00:42 +0200 Subject: 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 --- util/cmake/pro2cmake.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'util') diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 21946883fd..420df3011d 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -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 -- cgit v1.2.3