Mergeable Libraries using XCFramework

Hello.

On my app I have the necessity to use mergeable libraries, in my context my libraries are indirect dependency, in other words the dependency isn’t target in my project, and they are XCFramework where they are imported on Framework, Libraries, and Embedded Content session on my app target.

Following the documentation on Configuring your project to use mergeable libraries it said. 
 

But on Manually configure merging don’t said how to configure to indirect dependencies. 


 So I have tried configure use the linker flag -merge_framework for each XCFramework using -Wl, -merge_framework, {XCFramework_Name}, but I am receiving the following error unknown argument: -merge_framework’ when build the release.



In app target is set build settings MERGED_BINARY_TYPE = manual;

The question is: 


Is possible using mergeable libraries in XCFramework dependencies ? How I do this? Because on the doc is not clear how to use in indirect dependency like XCFramework. 



Regards


Michel Carvalho

Answered by DTS Engineer in 863140022

Rereading that doc I think the Other Linker Flags build setting is a red herring. The doc isn’t advising you to set that build setting, it’s explaining what Xcode does when you manually configure merging.

I think you need to re-read the Manually configure merging section of the doc. It outlines two steps:

As always, I think it’d be worthwhile you setting up a small test project to illustrate the issue. That’ll let you investigate in an isolated, and much simple, environment.

Share and Enjoy

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

So I have tried configure use the linker flag

Using the Other Linker Flags build settings?

If so, be aware that you have to escape each value in that setting. So, if you want to pass A, B, and C to the linker, you have to set the build setting to -Xlinker, A, -Xlinker, B, -Xlinker, C.

Share and Enjoy

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

Thank you for the answer.

But I still have doubts about mergeable libraries.

Is possible using mergeable libraries in XCFramework dependencies ? If so, How I do this? Because on the doc is not clear how to use in indirect dependency like XCFramework.

Rereading that doc I think the Other Linker Flags build setting is a red herring. The doc isn’t advising you to set that build setting, it’s explaining what Xcode does when you manually configure merging.

I think you need to re-read the Manually configure merging section of the doc. It outlines two steps:

As always, I think it’d be worthwhile you setting up a small test project to illustrate the issue. That’ll let you investigate in an isolated, and much simple, environment.

Share and Enjoy

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

Mergeable Libraries using XCFramework
 
 
Q