Files
cmake/Tests/RunCMake/EnableLanguageSubdir/CMP0220-WARN-stderr.txt
T
Arha Gatram 86759dce81 enable_language: add support for usage in subdirectories
Propagates variables set in enable_language() logic up variable scopes
so that the language can be used by targets in the ancestor directories.
Works through block() and function() scopes as well. The
add_subdirectory() call can be thought of as the effective call site for
enabling the language. The same holds for endblock() and the actual
function call.

Adds a policy CMP0220 to control this behavior. As the language is
"enabled" at each ancestor scope, the policy is checked. If OLD, the
language is not enabled at this scope and the ones above.

Closes: #27881 #27508 #27389
Related: #26751 #27564
2026-08-07 11:05:57 -04:00

11 lines
558 B
Plaintext

CMake Warning \(policy\) at cxx/CMakeLists\.txt:[0-9]+ \(enable_language\):
Policy CMP0220 is not set: Languages enabled in subdirectories propagate to
the top-level directory\. Run "cmake --help-policy CMP0220" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
For compatibility with older versions of CMake, the language configuration
set by this call is not propagated to the enclosing variable scopes\.
This warning is for project developers\. Use -Wno-author or -Wno-policy to
suppress it\.