diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-08-28 14:47:46 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-09-10 18:05:16 +0200 |
commit | 74c48f0864793ec1e3e0e62693a201f8cbb4a672 (patch) | |
tree | d2ebd11bdbc193b8a23fd4c36d28efbd46463625 /util | |
parent | 6b363bbde3d51e223fa7a6e4efeae68eb555eaa0 (diff) |
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>
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 ") |