Skip to content

Modules: Ensure policy settings allow expected features and don't leak

Craig Scott requested to merge craig.scott/cmake:module_policy_protection into master

Ensure that modules do not implicitly assume if(... IN_LIST ...) is allowed by policy settings, enforce it with appropriate push-pop of the policy stack.

This work also uncovered two cases in the CMakeIOSInstallCombined module where policy settings were being modified within function calls without doing any push-pop of the policy stack, so callers would have been affected. It wasn't clear if lifting the policy change for CMP0007 out to the file scope would break backward compatibility, so that one was left where it was with its own local push-pop. The CMP0057 change was safe to lift out though.

Merge request reports