Unknown argument "merge_framework"?

I have built a mergeable framework for distribution using Xcode 15. But when I try to merge it into an App target using -merge_framework in "Other linker flags", I get the error "Unknown argument: '-merge_framework'"? I'm not sure if the new linker is being used, but I assumed it would be used by default and I'm not sure of a way to enable it if not.

This is one of those weird gotchas. The Other Linker Flags (OTHER_LDFLAGS) build setting is passed to the compiler driver. You have to tell it to pass those flags on to the linker. So, for example, if you wanted to create a link map, you don’t set it to -map link-map.txt you set it to -XXlinker -map -XXlinker link-map.txt. If you do the same for -merge_framework, it should work.

Having said that, Xcode has high-level build settings for this specific feature, and that’s what you should be using here. See Configuring your project to use mergeable libraries.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Unknown argument "merge_framework"?
 
 
Q