Commit Graph

3 Commits

Author SHA1 Message Date
Brad King
ad3c2c0b03 Help: Normalize and consolidate standard policy advice paragraph
Every policy's documentation has a paragraph on what version of CMake
introduced it, how to set the policy, and whether CMake warns if the
policy is not set.  The wording of this paragraph has diverged across
policies over time.  Factor the paragraph out into a standard advice
document included by every policy.
2024-01-11 14:48:01 -05:00
Brad King
a6562ff579 try_compile: Add option to skip passing platform variables
Add a `CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable to tell
`try_compile` not to pass platform variables to the test project.

Issue: #23219
2022-05-16 10:47:21 -04:00
Brad King
4843a37676 try_compile: Propagate platform variables in project-mode too
Add policy CMP0137 to propagate both our builtin variables and those
listed by `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` to `try_compile`
whole-project builds.

Inspired-by: Alexander Neumann <Alexander.Neumann@hamburg.de>
Fixes: #23219
2022-05-16 10:39:42 -04:00