iOS build target

I also added a flag to fix building on OSX.