diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-10-15 10:00:42 +0200 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-10-15 08:06:00 +0000 |
commit | 1f9d2412163282b46135a08244268e84c430d7c6 (patch) | |
tree | b5b49df284fa923ab7a83d9a7ea5bb00b0902a7b | |
parent | 190e9dcdcf1a2debfbf624af4cb2154172908a64 (diff) |
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>
-rwxr-xr-x | util/cmake/pro2cmake.py | 12 |
1 files changed, 6 insertions, 6 deletions
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 |