0

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

Community
  • 1
  • 1
Payne Chu
  • 543
  • 1
  • 5
  • 15
  • Do you have a copy files build phase? What you really need here is to copy the library that is the product of the dependancy into the bundle. – quellish Jun 26 '14 at 02:59
  • @quellish thanks for your reply, I'm not targeting to just copy the .a to .bundle. I'm finding a way to make .a link and build a binary inside the .bundle – Payne Chu Jun 26 '14 at 03:11
  • I'm not sure what you're trying to accomplish then - can you elaborate on why you're trying to build a binary inside the bundle, rather than copy a binary into it? Why is it unacceptable to build a target that produces a library, and then copy that library into the bundle that is the product of another target? – quellish Jun 26 '14 at 03:13
  • Because I need to create a (.bundle) Unity3D understand. just copy the (.a) to (.bundle) Unity3D still will not understand. Anyways I figure out how it work and already put the answer below :) thanks – Payne Chu Jun 26 '14 at 03:24

1 Answers1

0

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

Payne Chu
  • 543
  • 1
  • 5
  • 15