mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 04:40:18 -05:00
Merge topic 'GNU-linker-pushpop_state-detection' into release-4.0
d5be7c7f31Linker: Detect GNU push-state/pop-state flags more robustly7b552b9a64Linker: Save GNU push-/pop-state detection with compiler inspection resultsa9b126b0daLinker: Save linker inspection results with compiler inspection results3f5f2b2d49Linker: Honor CMAKE_<LANG>_LINK_LIBRARY_USING_FEATURE_SUPPORTED when FALSE Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !10468
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -941,9 +941,9 @@ void cmGlobalGenerator::EnableLanguage(
|
||||
} // end if in try compile
|
||||
} // end need test language
|
||||
|
||||
// load linker configuration, if required
|
||||
if (mf->GetDefinition(cmStrCat("CMAKE_", lang, "_USE_LINKER_INFORMATION"))
|
||||
.IsOn()) {
|
||||
// load linker configuration, if required
|
||||
if (mf->IsOn(cmStrCat("CMAKE_", lang, "_COMPILER_WORKS")) &&
|
||||
mf->IsOn(cmStrCat("CMAKE_", lang, "_USE_LINKER_INFORMATION"))) {
|
||||
std::string langLinkerLoadedVar =
|
||||
cmStrCat("CMAKE_", lang, "_LINKER_INFORMATION_LOADED");
|
||||
if (!mf->GetDefinition(langLinkerLoadedVar)) {
|
||||
@@ -960,6 +960,18 @@ void cmGlobalGenerator::EnableLanguage(
|
||||
"Could not process cmake module file: ", informationFile));
|
||||
}
|
||||
}
|
||||
|
||||
if (needTestLanguage[lang]) {
|
||||
if (!this->CMakeInstance->GetIsInTryCompile()) {
|
||||
std::string testLang =
|
||||
cmStrCat("Internal/CMakeInspect", lang, "Linker.cmake");
|
||||
std::string ifpath = mf->GetModulesFile(testLang);
|
||||
if (!mf->ReadListFile(ifpath)) {
|
||||
cmSystemTools::Error(
|
||||
cmStrCat("Could not find cmake module file: ", testLang));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Translate compiler ids for compatibility.
|
||||
|
||||
Reference in New Issue
Block a user