mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-29 02:19:18 -05:00
Xcode: Don't add framework as -framework argument in linker info list
This commit is contained in:
committed by
Craig Scott
parent
468bcc3291
commit
ce2dee9e5b
@@ -1293,11 +1293,17 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
|
||||
// add runtime information
|
||||
this->AddLibraryRuntimeInfo(full_fw);
|
||||
|
||||
// Add the item using the -framework option.
|
||||
this->Items.emplace_back(std::string("-framework"), false);
|
||||
cmOutputConverter converter(this->Makefile->GetStateSnapshot());
|
||||
fw = converter.EscapeForShell(fw);
|
||||
this->Items.emplace_back(fw, false);
|
||||
if (this->GlobalGenerator->IsXcode()) {
|
||||
// Add framework path - it will be handled by Xcode after it's added to
|
||||
// "Link Binary With Libraries" build phase
|
||||
this->Items.emplace_back(item, true);
|
||||
} else {
|
||||
// Add the item using the -framework option.
|
||||
this->Items.emplace_back(std::string("-framework"), false);
|
||||
cmOutputConverter converter(this->Makefile->GetStateSnapshot());
|
||||
fw = converter.EscapeForShell(fw);
|
||||
this->Items.emplace_back(fw, false);
|
||||
}
|
||||
}
|
||||
|
||||
void cmComputeLinkInformation::AddDirectoryItem(std::string const& item)
|
||||
|
||||
@@ -3579,8 +3579,16 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
|
||||
for (auto const& libItem : configItemMap[configName]) {
|
||||
auto const& libName = *libItem;
|
||||
if (libName.IsPath) {
|
||||
libPaths.Add(this->XCodeEscapePath(libName.Value.Value));
|
||||
const auto libPath = GetLibraryOrFrameworkPath(libName.Value.Value);
|
||||
if (cmSystemTools::StringEndsWith(libPath.c_str(), ".framework")) {
|
||||
const auto fwName =
|
||||
cmSystemTools::GetFilenameWithoutExtension(libPath);
|
||||
const auto fwDir = cmSystemTools::GetParentDirectory(libPath);
|
||||
libPaths.Add("-F " + this->XCodeEscapePath(fwDir));
|
||||
libPaths.Add("-framework " + fwName);
|
||||
} else {
|
||||
libPaths.Add(this->XCodeEscapePath(libName.Value.Value));
|
||||
}
|
||||
if ((!libName.Target || libName.Target->IsImported()) &&
|
||||
IsLinkPhaseLibraryExtension(libPath)) {
|
||||
// Create file reference for embedding
|
||||
|
||||
Reference in New Issue
Block a user