From c1e0e0adb2fb5c62f4d1677a85c677c57e2737f3 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 11 Nov 2019 19:09:59 +0100 Subject: [PATCH] pro2cmake: Fix incorrect replacement of x86 conditions The regular expression used to eat the character that comes after the x86 token, which was incorrect when matching x86SimdAlways. Fix the regular expression to use a lookahead with a negative character class of word characters. Change-Id: I9ed8f9a490369bf5704b752f8bba3b7118a2cd5b Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index b40c35e3552..b95b469e371 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1299,7 +1299,7 @@ def map_condition(condition: str) -> str: condition = condition.replace("|", " OR ") # new conditions added by the android multi arch qmake build - condition = re.sub(r"(^| )x86([^\_]|$)", "TEST_architecture_arch STREQUAL i386", condition) + condition = re.sub(r"(^| )x86((?=[^\w])|$)", "TEST_architecture_arch STREQUAL i386", 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)