Any way to make bundle xcode project to include a

2019-09-18 17:46发布

I have a static library xcode project (.a) and a bundle xcode project (.bundle) I added the (.a) as a sub project of (.bundle) and added to [Target Dependencies] and [Link Binary With Libraries].

After run the bulid the (.bundle) still not contain any binary file inside (.bundle).

It's work if I add the .c and .h files to under (.bundle) directly, but that make me need to handle two project files. Any way can make (.bundle) just build with the (.a) ?

This question same as what I asked, I tried to follow his 11 steps without the step 10 because he said lastly no need that step. But the generated (.bundle) still without contain any binary

标签: ios xcode static
1条回答
狗以群分
2楼-- · 2019-09-18 18:28

Finally, I make it work.

The step 10 still important and below is corrected step 10.

  • create a dummy.c under (.bundle) project and the dummy.c can just totally empty. remove the setting for the library you want to link inside Link Binary With Libraries instead use -Wl,-force_load,$(CONFIGURATION_BUILD_DIR)/libYourLib.a or -all_load to Other Linker Flags

PS: And also can use sub-project instead of workspace. and use Target Dependencies instead of Edit Scheme to achieve the same effect.

The testing project

查看更多
登录 后发表回答