summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-03-03 22:08:31 (GMT)
committerBrad King <brad.king@kitware.com>2011-03-03 22:12:32 (GMT)
commit5abfb571843dba949e010f3b2840d8882d0f3d73 (patch)
treeedac42b4048edf66a657c0a9c5f30f7949d2d368 /Source/cmComputeLinkInformation.cxx
parentcbb5ae60be15738a4d6db4607466346153c3dbba (diff)
downloadCMake-5abfb571843dba949e010f3b2840d8882d0f3d73.zip
CMake-5abfb571843dba949e010f3b2840d8882d0f3d73.tar.gz
CMake-5abfb571843dba949e010f3b2840d8882d0f3d73.tar.bz2
Add target property LINK_SEARCH_START_STATIC to aid static linking
Commit afd7d4ca (Add target property LINK_SEARCH_END_STATIC, 2008-01-31) defined a property to ensure that static runtime libraries get selected. Add a property to specify that all libraries whose type is unknown, such as "-lm", should be assumed static. Furthermore it assumes that an option such as "-static" is also used so that no initial -Bstatic is needed.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index d53200c..e3c33a2 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -817,9 +817,9 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
this->SharedLinkTypeFlag = shared_link_type_flag;
}
- // TODO: Lookup the starting link type from the target (is it being
- // linked statically?).
- this->StartLinkType = LinkShared;
+ // Lookup the starting link type from the target (linked statically?).
+ const char* lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
+ this->StartLinkType = cmSystemTools::IsOn(lss)? LinkStatic : LinkShared;
this->CurrentLinkType = this->StartLinkType;
}