summaryrefslogtreecommitdiffstats
path: root/util/cmake/condition_simplifier_cache.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-07 15:28:05 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-07 13:36:11 +0000
commitb86630b4b0c2fc76c49baed205b3bbfc0fa612cb (patch)
treead64079c4e325fe97606df86affdd115fbfceb68 /util/cmake/condition_simplifier_cache.py
parentf55565b77aeec6b166f1656d20094a624f48ea9d (diff)
pro2cmake: Allow disabling condition cache
New option --skip-condition-cache allows forcing recomputation of condition simplification. Useful when debugging certain condition mappings. Change-Id: I68a85c2e4085ad7a3043d7334db71a334a6469e9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'util/cmake/condition_simplifier_cache.py')
-rw-r--r--util/cmake/condition_simplifier_cache.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/cmake/condition_simplifier_cache.py b/util/cmake/condition_simplifier_cache.py
index b405ef23f8..d1efff1d87 100644
--- a/util/cmake/condition_simplifier_cache.py
+++ b/util/cmake/condition_simplifier_cache.py
@@ -37,6 +37,13 @@ import time
from typing import Callable
+condition_simplifier_cache_enabled = True
+
+
+def set_condition_simplified_cache_enabled(value: bool):
+ global condition_simplifier_cache_enabled
+ condition_simplifier_cache_enabled = value
+
def get_current_file_path() -> str:
try:
@@ -106,7 +113,7 @@ def simplify_condition_memoize(f: Callable[[str], str]):
atexit.register(update_cache_file)
def helper(condition: str) -> str:
- if condition not in cache_file_content["cache"]["conditions"]:
+ if condition not in cache_file_content["cache"]["conditions"] or not condition_simplifier_cache_enabled:
cache_file_content["cache"]["conditions"][condition] = f(condition)
return cache_file_content["cache"]["conditions"][condition]