diff options
author | Cristián Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2019-09-19 14:27:18 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2019-09-20 06:38:56 +0000 |
commit | 3b7aa8aee855a939984473a0fc32383c43ec7620 (patch) | |
tree | a2267ba5902e02c4dd3a4b277d636a7b56cad109 /util | |
parent | c40cc543d0b579ffbfa06e079271efcd839b72ae (diff) |
pro2cmake: skip tuple declaration on condition str
In some cases after cleaning and simplifying the conditions
you can end up with the following line:
((()))
Python interprets that as an empty tuple:
>>> a = ((()))
>>> a
()
and then the simplify_condition (sympy) method fails to continue
with an error:
File ".../util/cmake/pro2cmake.py", line 1993, in simplify_condition
condition_expr = simplify_logic(condition)
File ".../sympy/logic/boolalg.py", line 2292, in simplify_logic
expr = expr.xreplace(dict(zip(variables, s)))
AttributeError: 'tuple' object has no attribute 'xreplace'
You can see this behavior with the file:
qtmultimedia/tests/auto/unit/multimediaqml.pro
Change-Id: Ied4285b67f1e567660be49f6610311199bc48a22
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/pro2cmake.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 51cce8027c..df81974ef1 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1598,6 +1598,8 @@ def handle_subdir( if condition_str and subtraction_str: condition_str += " AND " condition_str += subtraction_str + if not condition_str.rstrip("()").strip(): + continue condition_simplified = simplify_condition(condition_str) condition_key = condition_simplified |