summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-03-09 14:52:46 (GMT)
committerBrad King <brad.king@kitware.com>2011-03-09 14:52:46 (GMT)
commitc6a8e4c71ad56df8f7de30bfed3a3d9d62419325 (patch)
treea7bd8f1f76d035c33530e1ea682f0e563dc1863b /Source/cmTarget.cxx
parent9ae65b866e4de737be00d3518da36aedca322278 (diff)
downloadCMake-c6a8e4c71ad56df8f7de30bfed3a3d9d62419325.zip
CMake-c6a8e4c71ad56df8f7de30bfed3a3d9d62419325.tar.gz
CMake-c6a8e4c71ad56df8f7de30bfed3a3d9d62419325.tar.bz2
The link interface of MODULE libraries is empty (#11945)
MODULE libraries cannot be linked into other libraries and executables (just like executables without ENABLE_EXPORTS). Set the MODULE target link interface to be empty. This allows such targets to be installed in an EXPORT set without including all their private implementation dependencies.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 72efce3..b5900c4 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4278,9 +4278,13 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface)
}
}
- // There is no implicit link interface for executables, so if none
- // was explicitly set, there is no link interface.
- if(!explicitLibraries && this->GetType() == cmTarget::EXECUTABLE)
+ // There is no implicit link interface for executables or modules
+ // so if none was explicitly set then there is no link interface.
+ // Note that CMake versions 2.2 and below allowed linking to modules.
+ bool canLinkModules = this->Makefile->NeedBackwardsCompatibility(2,2);
+ if(!explicitLibraries &&
+ (this->GetType() == cmTarget::EXECUTABLE ||
+ this->GetType() == cmTarget::MODULE_LIBRARY && !canLinkModules))
{
return false;
}