configurejson2cmake: Handle expressions of the form "foo != 0"

Such expressions were translated to "foo NOT = 0" which is invalid code.

Change-Id: I8b485bfe1d1f553c08df3b5d59b0f39f2dcbd5c0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Joerg Bornemann 2020-08-28 14:47:46 +02:00
parent 6b363bbde3
commit 74c48f0864

View File

@ -284,6 +284,8 @@ def map_condition(condition):
# Turn foo != "bar" into (NOT foo STREQUAL 'bar')
condition = re.sub(r"([^ ]+)\s*!=\s*('.*?')", "(! \\1 == \\2)", condition)
# Turn foo != 156 into (NOT foo EQUAL 156)
condition = re.sub(r"([^ ]+)\s*!=\s*([0-9]?)", "(! \\1 EQUAL \\2)", condition)
condition = condition.replace("!", "NOT ")
condition = condition.replace("&&", " AND ")