From 74c48f0864793ec1e3e0e62693a201f8cbb4a672 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 28 Aug 2020 14:47:46 +0200 Subject: 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 --- util/cmake/configurejson2cmake.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util') diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index aff840f850..2dfd8e16a0 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -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 ") -- cgit v1.2.3