diff options
author | Brad King <brad.king@kitware.com> | 2015-10-12 14:26:20 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-10-12 14:26:20 (GMT) |
commit | aad0e62060783539ef8ec4d09ad12ed9dacb5e7c (patch) | |
tree | 9f3318ad0e0774e8cec723819f611b6a83aa53f3 /Source/cmComputeLinkInformation.cxx | |
parent | 83d2b6f378ddb462a105c2754f0b061f31709655 (diff) | |
parent | 1c1c2a1201682d17491026cb392c31ae5e63e1a5 (diff) | |
download | CMake-aad0e62060783539ef8ec4d09ad12ed9dacb5e7c.zip CMake-aad0e62060783539ef8ec4d09ad12ed9dacb5e7c.tar.gz CMake-aad0e62060783539ef8ec4d09ad12ed9dacb5e7c.tar.bz2 |
Merge topic 'use-generator-target'
1c1c2a12 cmGeneratorTarget: Port ExpandLinkItems away from cmTarget.
c66084f5 cmGeneratorTarget: Port GetImportLinkInterface away from cmTarget.
83c29e39 cmGeneratorTarget: Port ComputeLinkImplementationLibraries away from cmTarget.
19882554 cmGeneratorTarget: Port handleSystemIncludesDep away from cmTarget.
c1f687b1 cmGeneratorTarget: Port GetLinkImplementationLibrariesInternal.
a6e1f05c cmGeneratorTarget: Port ComputeLinkInterface away from cmTarget.
654002fe cmGeneratorTarget: Port ComputeLinkInterfaceLibraries away from cmTarget.
922c8901 cmGeneratorTarget: Port GetLinkInterface away from cmTarget.
eaa5b9cb cmGeneratorTarget: Port cmTargetCollectLinkLanguages away from cmTarget.
f539da12 cmGeneratorTarget: Port GetLinkInterfaceLibraries away from cmTarget.
1c5d70f9 cmGeneratorTarget: Port processILibs away from cmTarget.
064c2488 cmComputeLinkDepends: Port some API to cmGeneratorTarget.
3e428fdc cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget.
110fd2fb cmGeneratorTarget: Move GetOutputTargetType from cmTarget.
e7391699 cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget.
c5718217 cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget.
...
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ff3d1ee..c76cb7a 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -632,11 +632,11 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang) //---------------------------------------------------------------------------- void cmComputeLinkInformation::AddItem(std::string const& item, - cmTarget const* tgt) + cmGeneratorTarget const* tgt) { // Compute the proper name to use to link this library. const std::string& config = this->Config; - bool impexe = (tgt && tgt->IsExecutableWithExports()); + bool impexe = (tgt && tgt->Target->IsExecutableWithExports()); if(impexe && !this->UseImportLibrary && !this->LoaderFlag) { // Skip linking to executables on platforms with no import @@ -644,9 +644,8 @@ void cmComputeLinkInformation::AddItem(std::string const& item, return; } - if(tgt && tgt->IsLinkable()) + if(tgt && tgt->Target->IsLinkable()) { - cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(tgt); // This is a CMake target. Ask the target for its real name. if(impexe && this->LoaderFlag) { @@ -656,10 +655,10 @@ void cmComputeLinkInformation::AddItem(std::string const& item, std::string linkItem; linkItem = this->LoaderFlag; - std::string exe = gtgt->GetFullPath(config, this->UseImportLibrary, + std::string exe = tgt->GetFullPath(config, this->UseImportLibrary, true); linkItem += exe; - this->Items.push_back(Item(linkItem, true, tgt)); + this->Items.push_back(Item(linkItem, true, tgt->Target)); this->Depends.push_back(exe); } else if(tgt->GetType() == cmTarget::INTERFACE_LIBRARY) @@ -667,7 +666,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, // Add the interface library as an item so it can be considered as part // of COMPATIBLE_INTERFACE_ enforcement. The generators will ignore // this for the actual link line. - this->Items.push_back(Item(std::string(), true, tgt)); + this->Items.push_back(Item(std::string(), true, tgt->Target)); } else { @@ -677,15 +676,15 @@ void cmComputeLinkInformation::AddItem(std::string const& item, (impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY)); // Pass the full path to the target file. - std::string lib = gtgt->GetFullPath(config, implib, true); + std::string lib = tgt->GetFullPath(config, implib, true); if(!this->LinkDependsNoShared || tgt->GetType() != cmTarget::SHARED_LIBRARY) { this->Depends.push_back(lib); } - this->AddTargetItem(lib, tgt); - this->AddLibraryRuntimeInfo(lib, tgt); + this->AddTargetItem(lib, tgt->Target); + this->AddLibraryRuntimeInfo(lib, tgt->Target); } } else @@ -716,7 +715,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, //---------------------------------------------------------------------------- void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, - cmTarget const* tgt) + const cmGeneratorTarget* tgt) { // If dropping shared library dependencies, ignore them. if(this->SharedDependencyMode == SharedDepModeNone) @@ -760,18 +759,14 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, return; } - cmGeneratorTarget *gtgt = 0; - // Get a full path to the dependent shared library. // Add it to the runtime path computation so that the target being // linked will be able to find it. std::string lib; if(tgt) { - gtgt = this->GlobalGenerator->GetGeneratorTarget(tgt); - - lib = gtgt->GetFullPath(this->Config, this->UseImportLibrary); - this->AddLibraryRuntimeInfo(lib, tgt); + lib = tgt->GetFullPath(this->Config, this->UseImportLibrary); + this->AddLibraryRuntimeInfo(lib, tgt->Target); } else { @@ -795,9 +790,9 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, } if(order) { - if(gtgt) + if(tgt) { - std::string soName = gtgt->GetSOName(this->Config); + std::string soName = tgt->GetSOName(this->Config); const char* soname = soName.empty()? 0 : soName.c_str(); order->AddRuntimeLibrary(lib, soname); } @@ -1101,9 +1096,10 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item, this->SharedLibrariesLinked.insert(target); } + cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target); // Handle case of an imported shared library with no soname. if(this->NoSONameUsesPath && - target->IsImportedSharedLibWithoutSOName(this->Config)) + gtgt->IsImportedSharedLibWithoutSOName(this->Config)) { this->AddSharedLibNoSOName(item); return; @@ -1783,12 +1779,13 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath, cmTarget const* target) { + cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target); // Ignore targets on Apple where install_name is not @rpath. // The dependenty library can be found with other means such as // @loader_path or full paths. if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { - if(!target->HasMacOSXRpathInstallNameDir(this->Config)) + if(!gtgt->HasMacOSXRpathInstallNameDir(this->Config)) { return; } @@ -1810,7 +1807,6 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath, // Try to get the soname of the library. Only files with this name // could possibly conflict. - cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(target); std::string soName = gtgt->GetSOName(this->Config); const char* soname = soName.empty()? 0 : soName.c_str(); @@ -1920,7 +1916,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, (for_install || this->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH")); bool use_install_rpath = - (outputRuntime && this->Target->Target->HaveInstallTreeRPATH() && + (outputRuntime && this->Target->HaveInstallTreeRPATH() && linking_for_install); bool use_build_rpath = (outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config) && |