简体   繁体   中英

3rd party C++ libs in RubyMotion

I'm trying to compile some 3rd party C++ libraries for iOS development with RubyMotion. I have an Objective-C wrapper around the libraries, in the form of .h and .mm files, but I have no idea what to do with them.

I'm assuming they go in my_app/vendor/my_lib/, but how do I tell RubyMotion about the files?

I've added the library to my project in my Rakefile:

app.vendor_project('vendor/my_lib', :static)

This picks up the .h/.a files. Will RubyMotion pick up .the mm (and corresponding .h) file as well, or do I need to flag this file as being a wrapper?

You need to add a line to your Rakefile in the App.setup section like this:

app.vendor_project('vendor/my_lib', :static)

That will make the build process look in that directory for .h/.mm files to compile, as well as .a files to link into the app. There's a little more info here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM