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 <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexandru Croitor 2019-11-11 19:09:59 +01:00
parent 4fe8330b5b
commit c1e0e0adb2

View File

@ -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)