Fix linking to OS X Frameworks named with spaces (#12550)
Teach cmComputeLinkInformation to generate the "-framework" option as a separate link item preceding the actual framework name. Then escape the framework name to pass as an argument through a shell. This fixes the link line for frameworks with spaces in the name. The build system generators that call cli.GetItems() and generate the final list of items on the link line already handle escaping correctly for items that are paths. However, for raw link items like "-lfoo" they just pass through to the command line verbatim. This is incorrect. The generators should escape these items too. Unfortunately we cannot fix that without introducing a new CMake Policy because projects may already be passing raw link flags with their own escapes to work around this bug. Therefore we punt on this bug for now and go with the above fix.
This commit is contained in:
parent
d4afce1ddd
commit
e74f3744ae
|
@ -1318,8 +1318,9 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
|
|||
this->AddFrameworkPath(this->SplitFramework.match(1));
|
||||
|
||||
// Add the item using the -framework option.
|
||||
std::string fw = "-framework ";
|
||||
fw += this->SplitFramework.match(2);
|
||||
this->Items.push_back(Item("-framework", false));
|
||||
std::string fw = this->SplitFramework.match(2);
|
||||
fw = this->LocalGenerator->EscapeForShell(fw.c_str());
|
||||
this->Items.push_back(Item(fw, false));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue