Convert C & submodule included objective-C project (linphone) as a framework or static library?

谁说胖子不能爱 提交于 2019-12-04 05:31:32

问题


I want to merge two projects.

First project

  1. Written in objective C and swift 2.3
  2. Pod dependencies
  3. Have different Targets
  4. Submodules dependencies

Second project

https://github.com/BelledonneCommunications/linphone

  1. Written in Objective C
  2. dependency on linphone SDK written in C
  3. Submodules dependencies

How can I convert Second project(linphone) as a framework?

EDIT 1

I have integrated linphone project(second project) including the C written linphone SDK and Rectified all compile time errors. and now i am able to run the project. But what I will do for Submodules dependencies?

EDIT 2

As per now, succeed login with our own SIP server account. Right now my issue is

LinphoneManager
 - (void)createLinphoneCore
 - theLinphoneCore = linphone_core_new_with_config(&linphonec_vtable, _configDb, (__bridge void *)(self)); 

theLinphoneCore is NULL, why?

NOTE: Still i didnt integrate submodules, but i can do audio & video call everything works fine.


回答1:


The only sane way to build a complete liblinphone SDK is through the appropriate client repository, e.g. linphone-iphone or linphone-android. As you have discovered, it is possible to build as a framework or static library using:

./prepare.py -c && ./prepare.py -DENABLE_STATIC_ONLY=ON && make && make zipsdk

Set DENABLE_STATIC_ONLY=ON for libs, and =OFF for a framework:

Be aware: as of June 2017, the framework configuration is still under development. It builds and runs in the simulator and on actual hardware, but the resulting app binary can't be submitted to Apple because the sub-frameworks aren't configured correctly. If you don't need to submit (not even TestFlight!) for 2-6 months maybe they will finish up soon.

If you need a functional product sooner, use the static lib configuration. The only tricky part is getting everything set up in your project/workspace.

  1. Do a full clean and build using prepare.py as above
  2. Extract the sdk zip file into your own project directory as liblinphone-sdk
  3. Add the libraries in liblinphone-sdk/apple-darwin/lib to XCode's Linked Frameworks and Libraries section under General. Click +, select "Add Other", navigate to the libs directory. Don't forget to include any in liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins
  4. You may need to add a Build Setting for Header Search Path $(SRCROOT)/liblinphone-sdk/apple-darwin/include
  5. You may need to add a Build Setting for Library Search Path $(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib
  6. The XCode project for linphone-iPhone is a good place to discover other tweaks you may need to make.

Setting up your workspace will probably require trial and error. Xcode is not great with the errors but you should be able to use the Report Navigator view to see complete build logs and error messages. If you have an undefined symbol for example, you can try grep -ri SYMBOLNAME liblinphone-sdk to figure out what library might be missing.

Regarding your EDIT 2 question, you need all the submodules or it won't work. ortp, belle-sip, mediastreamer, srtp, mbedtls, they are all essential. Only the mediastreamer plugin codecs are (somewhat) optional.



来源:https://stackoverflow.com/questions/44253641/convert-c-submodule-included-objective-c-project-linphone-as-a-framework-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!