summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1c37e52..8ac19fc 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -8518,6 +8518,30 @@ bool cmGeneratorTarget::IsLinkable() const
this->IsExecutableWithExports());
}
+bool cmGeneratorTarget::HasLinkDependencyFile(std::string const& config) const
+{
+ if (this->GetType() != cmStateEnums::EXECUTABLE &&
+ this->GetType() != cmStateEnums::SHARED_LIBRARY &&
+ this->GetType() != cmStateEnums::MODULE_LIBRARY) {
+ return false;
+ }
+
+ if (this->Target->GetProperty("LINK_DEPENDS_NO_SHARED").IsOn()) {
+ // Do not use the linker dependency file because it includes shared
+ // libraries as well
+ return false;
+ }
+
+ const std::string depsUseLinker{ "CMAKE_LINK_DEPENDS_USE_LINKER" };
+ auto linkLanguage = this->GetLinkerLanguage(config);
+ const std::string langDepsUseLinker{ cmStrCat("CMAKE_", linkLanguage,
+ "_LINK_DEPENDS_USE_LINKER") };
+
+ return (!this->Makefile->IsDefinitionSet(depsUseLinker) ||
+ this->Makefile->IsOn(depsUseLinker)) &&
+ this->Makefile->IsOn(langDepsUseLinker);
+}
+
bool cmGeneratorTarget::IsFrameworkOnApple() const
{
return this->Target->IsFrameworkOnApple();