问题
I want to merge two projects.
First project
- Written in objective C and swift 2.3
- Pod dependencies
- Have different Targets
- Submodules dependencies
Second project
https://github.com/BelledonneCommunications/linphone
- Written in Objective C
- dependency on linphone SDK written in C
- 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.
- Do a full clean and build using prepare.py as above
- Extract the sdk zip file into your own project directory as liblinphone-sdk
- 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
- You may need to add a Build Setting for Header Search Path
$(SRCROOT)/liblinphone-sdk/apple-darwin/include
- You may need to add a Build Setting for Library Search Path
$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib
- 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