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

后端 未结 1 1893
被撕碎了的回忆
被撕碎了的回忆 2021-01-25 16:00

I want to merge two projects.

First project

  1. Written in objective C and swift 2.3
  2. Pod dependencies
  3. Have different Targe
1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-25 16:42

    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.

    0 讨论(0)
提交回复
热议问题