summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmComputeLinkInformation.cxx10
-rw-r--r--Source/cmTarget.cxx12
2 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 1e340c0..ec55c45 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -340,7 +340,15 @@ bool cmComputeLinkInformation::Compute()
// Restore the target link type so the correct system runtime
// libraries are found.
- this->SetCurrentLinkType(this->StartLinkType);
+ const char* lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
+ if(cmSystemTools::IsOn(lss))
+ {
+ this->SetCurrentLinkType(LinkStatic);
+ }
+ else
+ {
+ this->SetCurrentLinkType(this->StartLinkType);
+ }
// Compute the linker search path.
this->ComputeLinkerSearchDirectories();
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 6575140..e007367 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -285,6 +285,18 @@ void cmTarget::DefineProperties(cmake *cm)
"This is the configuration-specific version of LINK_FLAGS.");
cm->DefineProperty
+ ("LINK_SEARCH_END_STATIC", cmProperty::TARGET,
+ "End a link line such that static system libraries are used.",
+ "Some linkers support switches such as -Bstatic and -Bdynamic "
+ "to determine whether to use static or shared libraries for -lXXX "
+ "options. CMake uses these options to set the link type for "
+ "libraries whose full paths are not known or (in some cases) are in "
+ "implicit link directories for the platform. By default the "
+ "linker search type is left at -Bdynamic by the end of the library "
+ "list. This property switches the final linker search type to "
+ "-Bstatic.");
+
+ cm->DefineProperty
("LINKER_LANGUAGE", cmProperty::TARGET,
"What tool to use for linking, based on language.",
"The LINKER_LANGUAGE property is used to change the tool "