How to use libtool to create a dylib for iOS simulator?

764 Views Asked by At

My goal is to create a dylib using libtool. I'm on macOS, so it's not GNU libtool.

I tried to run libtool -dynamic -o foo.dylib *.o -syslibroot $(xcrun --show-sdk-path --sdk iphonesimulator), but got a bunch errors saying

ld: warning: building for macOS, but linking in object file (foo.o) built for iOS Simulator

(Yes, the .o file is targeted at simulator.)

It seems by default libtool creates the dylib for macOS, but I couldn't find where to specify the platform. libtool doesn't accepct -target or -platform_version.

So, how can I use libtool to create a dylib for iOS simulator? Thanks!

0

There are 0 best solutions below