summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-11-05 11:46:26 (GMT)
committerBrad King <brad.king@kitware.com>2013-01-10 14:54:52 (GMT)
commit3581b96caa1d7bd6c02e85baf72ce28b5128e5e7 (patch)
tree048d95ad2d6d1071982b1a35c6ce87d35831cc81 /Source/cmLocalGenerator.cxx
parent042ecf0471be84ce6c3e6c32dae526fdbd9a3a14 (diff)
downloadCMake-3581b96caa1d7bd6c02e85baf72ce28b5128e5e7.zip
CMake-3581b96caa1d7bd6c02e85baf72ce28b5128e5e7.tar.gz
CMake-3581b96caa1d7bd6c02e85baf72ce28b5128e5e7.tar.bz2
Process the INTERFACE_PIC property from linked dependencies
This allows a dependee to inform a target that it should have its POSITION_INDEPENDENT_CODE property set to ON, or OFF. The value of the POSITION_INDEPENDENT_CODE property, if set, must be consistent with any INTERFACE_POSITION_INDEPENDENT_CODE properties on dependees. Add a test covering the consistency checks on platforms where they run.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b557ca1..ecf6b41 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1984,7 +1984,8 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags,
//----------------------------------------------------------------------------
void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target,
- std::string const& lang)
+ std::string const& lang,
+ const char *config)
{
int targetType = target->GetType();
@@ -1997,8 +1998,18 @@ void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target,
}
else
{
- // Add position independendent flags, if needed.
- if (target->GetPropertyAsBool("POSITION_INDEPENDENT_CODE"))
+ if (target->GetType() == cmTarget::OBJECT_LIBRARY)
+ {
+ if (target->GetPropertyAsBool("POSITION_INDEPENDENT_CODE"))
+ {
+ this->AddPositionIndependentFlags(flags, lang, targetType);
+ }
+ return;
+ }
+
+ if (target->GetLinkInterfaceDependentBoolProperty(
+ "POSITION_INDEPENDENT_CODE",
+ config))
{
this->AddPositionIndependentFlags(flags, lang, targetType);
}