Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set linker options for a Cordova plugin?

I am developing a Cordova plugin that uses a custom ios SDK framework. The framework depends on two binary libraries: libcurl.a and boost.a. Right now during development I install the plugin in a test application like this:

cordova platform add ios
cordova plugin add my.cool.plugin

The binaries are included in the framework and get copied to the project that installs the plugin. However, some linker options are missing. To get the project to build, I have to open xcode and perform two additional manual step:

open platforms/ios/MyCoolProject.xcodeproj/

First, I have to add the two libraries to Link Binary With Libraries section in Build Phases:

enter image description here

Second, I have to add two linker flags (-lz -lstdc++) to Other linker flags section of the project default target. enter image description here

I certainly would like a cordova add plugin my.cool.plugin to be sufficient to install the plugin. So my question is, how can I automatically perform these tasks when the plugin gets installed?

like image 491
Aras Avatar asked Feb 24 '14 04:02

Aras


1 Answers

for -lz -lstdc++ just add this in the plugin xml and it will work.

<framework src="libstdc++.dylib" />
<framework src="libz.dylib" />
like image 71
Raj Wilson Dsouza Avatar answered Sep 22 '22 05:09

Raj Wilson Dsouza