Add iOS build target, fix building for OSX