summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/cpp/cppwriteinitialization.h
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2023-08-23 17:48:34 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2023-09-06 17:22:07 +0200
commit65e04162d17dfe2d18fa302c930f0a3d68131a2e (patch)
tree80017a5a6ed85fe2d7b9caad17318dff4e66c0bb /src/tools/uic/cpp/cppwriteinitialization.h
parentc1d2356856481b32099cfc8fd5e6fdc856ea7d31 (diff)
CMake: Recompute features when dependent features are marked dirty
Before this change, if a user toggled a FEATURE_foo variable, we only recomputed the value for dependent features who's CONDITION would break with the new value. If the CONDITION was not broken, the dependent feature value would remain unchanged. For example if FEATURE_developer_build was OFF, and the user toggled it to ON, the FEATURE_private_tests value would remain OFF, because OFF is a valid value for private_tests' CONDITION. But we would like FEATURE_private_tests to become ON if we toggled FEATURE_developer_build to ON. To address this case, we need to recompute features who's dependent feature values have changed. The algorithm introduced by this change is: - keep track of initial dirty features, aka track when FEATURE_foo is different from QT_FEATURE_foo. We expect FEATURE_foo to be the variable that a user toggles in the cache file or an IDE. - when evaluating feature values, collect feature dependencies from the various expressions given to options like CONDITION, AUTODETECT - if any feature dependency is marked dirty, reset the feature value to its auto-computed value and mark the reset feature as dirty - repeat for all feature evaluations Because feature evaluation is eagerly recursive, we will successfully reset all features that need resetting. To ensure against unforeseen breakages, allow disabling this behavior by configuring with -DQT_NO_FEATURE_AUTO_RESET=ON Adjust some of the messages to contain more details. Note that the pre-existing behavior of resetting feature values when the condition can't be satisfied, stays. For example if FEATURE_developer_build is OFF and FEATURE_private_tests is manually toggled to ON, it will reset to OFF because its condition can't be satisfied (developer_build is still OFF). Amends 61943aefd68b7d88c5eb395c4e44d08a94a70ad0 [ChangeLog][Build System] The build system will now try to recompute configure features when dependent feature values are toggled by the user. Pick-to: 6.6 Fixes: QTBUG-96936 Task-number: QTBUG-85962 Task-number: QTBUG-112957 Task-number: QTBUG-116209 Change-Id: Ib627f3675df8a3b08f4936cdc9c51f2d6e15f58c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteinitialization.h')
0 files changed, 0 insertions, 0 deletions