summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-21 16:41:11 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-21 16:41:11 (GMT)
commitfd37a6ec3d31e65eed2dfa88246e86b8d0ab66ab (patch)
treee40d02f354785ea8c43e90f266cded73bba5f340 /Source/cmTarget.cxx
parent9f2f456e7db1f84cc6d10a64a8e515ad69afbe65 (diff)
downloadCMake-fd37a6ec3d31e65eed2dfa88246e86b8d0ab66ab.zip
CMake-fd37a6ec3d31e65eed2dfa88246e86b8d0ab66ab.tar.gz
CMake-fd37a6ec3d31e65eed2dfa88246e86b8d0ab66ab.tar.bz2
ENH: Better linker search path computation.
- Use linker search path -L.. -lfoo for lib w/out soname when platform sets CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME - Rename cmOrderRuntimeDirectories to cmOrderDirectories and generalize it for both soname constraints and link library constraints - Use cmOrderDirectories to order -L directories based on all needed constraints - Avoid processing implicit link directories - For CMAKE_OLD_LINK_PATHS add constraints from libs producing them to produce old ordering
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx43
1 files changed, 42 insertions, 1 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4e3a345..3da4627 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2048,7 +2048,17 @@ std::string cmTarget::GetSOName(const char* config)
// Lookup the imported soname.
if(cmTarget::ImportInfo const* info = this->GetImportInfo(config))
{
- return info->SOName;
+ if(info->NoSOName)
+ {
+ // The imported library has no builtin soname so the name
+ // searched at runtime will be just the filename.
+ return cmSystemTools::GetFilenameName(info->Location);
+ }
+ else
+ {
+ // Use the soname given if any.
+ return info->SOName;
+ }
}
else
{
@@ -2069,6 +2079,19 @@ std::string cmTarget::GetSOName(const char* config)
}
//----------------------------------------------------------------------------
+bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config)
+{
+ if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
+ {
+ if(cmTarget::ImportInfo const* info = this->GetImportInfo(config))
+ {
+ return info->NoSOName;
+ }
+ }
+ return false;
+}
+
+//----------------------------------------------------------------------------
std::string cmTarget::NormalGetRealName(const char* config)
{
// This should not be called for imported targets.
@@ -3054,6 +3077,9 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
// properties. The "IMPORTED_" namespace is reserved for properties
// defined by the project exporting the target.
+ // Initialize members.
+ info.NoSOName = false;
+
// Track the configuration-specific property suffix.
std::string suffix = "_";
suffix += desired_config;
@@ -3164,6 +3190,21 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
}
}
+ // Get the "no-soname" mark.
+ if(this->GetType() == cmTarget::SHARED_LIBRARY)
+ {
+ std::string soProp = "IMPORTED_NO_SONAME";
+ soProp += suffix;
+ if(const char* config_no_soname = this->GetProperty(soProp.c_str()))
+ {
+ info.NoSOName = cmSystemTools::IsOn(config_no_soname);
+ }
+ else if(const char* no_soname = this->GetProperty("IMPORTED_NO_SONAME"))
+ {
+ info.NoSOName = cmSystemTools::IsOn(no_soname);
+ }
+ }
+
// Get the import library.
if(this->GetType() == cmTarget::SHARED_LIBRARY ||
this->IsExecutableWithExports())