Linker: Honor CMAKE_<LANG>_LINK_LIBRARY_USING_FEATURE_SUPPORTED when FALSE

It is documented to override `CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED`.
This commit is contained in:
Marc Chevrier 2025-03-14 15:32:00 +01:00 committed by Brad King
parent e4bf5e4a53
commit 3f5f2b2d49

View File

@ -193,8 +193,8 @@ bool IsFeatureSupported(cmMakefile* makefile, std::string const& linkLanguage,
{
auto featureSupported = cmStrCat(
"CMAKE_", linkLanguage, "_LINK_LIBRARY_USING_", feature, "_SUPPORTED");
if (makefile->GetDefinition(featureSupported).IsOn()) {
return true;
if (cmValue perLangVar = makefile->GetDefinition(featureSupported)) {
return perLangVar.IsOn();
}
featureSupported =