Platform mismatch when linking opencore-amr libs for iOS platform
Describe the bug
When building for iOS platform, make command outputs such error:
ld: warning: building for iOS, but linking in dylib file (/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled/lib/libopencore-amrwb.dylib) built for macOS
Steps to reproduce
On my M1 Macbook Pro I compiled opencore-amr libs according to this link. In order to link it to ios build I ran this command:
./configure-iphone --with-opencore-amr=/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled
make dep passed without errors.
When running make I get such error: ... ld: warning: building for iOS, but linking in dylib file (/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled/lib/libopencore-amrwb.dylib) built for macOS ld: warning: building for iOS, but linking in dylib file (/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled/lib/libopencore-amrnb.dylib) built for macOS ld: warning: building for iOS, but linking in dylib file (/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled/lib/libvo-amrwbenc.dylib) built for macOS
PJSIP version
2.11
Context
Issue happens on M1 Macbook Pro (2020), Xcode 13.3
Log, call stack, etc
...
if test ! -d ../bin/samples/arm64-apple-darwin_ios; then mkdir -p ../bin/samples/arm64-apple-darwin_ios; fi
/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/../../../Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o ../bin/samples/arm64-apple-darwin_ios/pjsua2_demo \
output/pjsua2_sample-arm64-apple-darwin_ios/pjsua2_demo.o -L/Users/blah-blah/Downloads/source-codes/pjsua-macos/pjlib/lib -L/Users/blah-blah/Downloads/source-codes/pjsua-macos/pjlib-util/lib -L/Users/blah-blah/Downloads/source-codes/pjsua-macos/pjnath/lib -L/Users/blah-blah/Downloads/source-codes/pjsua-macos/pjmedia/lib -L/Users/blah-blah/Downloads/source-codes/pjsua-macos/pjsip/lib -L/Users/blah-blah/Downloads/source-codes/pjsua-macos/third_party/lib -O2 -miphoneos-version-min=7.0 -arch arm64 -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk -framework AudioToolbox -framework Foundation -L/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled/lib -lpjsua2-arm64-apple-darwin_ios -lstdc++ -lpjsua-arm64-apple-darwin_ios -lpjsip-ua-arm64-apple-darwin_ios -lpjsip-simple-arm64-apple-darwin_ios -lpjsip-arm64-apple-darwin_ios -lpjmedia-codec-arm64-apple-darwin_ios -lpjmedia-arm64-apple-darwin_ios -lpjmedia-videodev-arm64-apple-darwin_ios -lpjmedia-audiodev-arm64-apple-darwin_ios -lpjmedia-arm64-apple-darwin_ios -lpjnath-arm64-apple-darwin_ios -lpjlib-util-arm64-apple-darwin_ios -lsrtp-arm64-apple-darwin_ios -lresample-arm64-apple-darwin_ios -lgsmcodec-arm64-apple-darwin_ios -lspeex-arm64-apple-darwin_ios -lilbccodec-arm64-apple-darwin_ios -lg7221codec-arm64-apple-darwin_ios -lyuv-arm64-apple-darwin_ios -lwebrtc-arm64-apple-darwin_ios -lpj-arm64-apple-darwin_ios -lm -lpthread -framework CoreAudio -framework CoreFoundation -framework AudioToolbox -framework CFNetwork -framework UIKit -framework AVFoundation -framework UIKit -framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia -framework VideoToolbox -framework OpenGLES -lopencore-amrnb -lopencore-amrwb -lvo-amrwbenc -framework Network -framework Security -framework Network -framework Security -framework Network -framework Security
ld: warning: building for iOS, but linking in dylib file (/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled/lib/libopencore-amrwb.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled/lib/libopencore-amrnb.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/Users/blah-blah/Downloads/source-codes/opencore-amr-compiled/lib/libvo-amrwbenc.dylib) built for macOS
@sauwming , I would appreciate if you could give me a hint on how to compile opencore-amr correctly for iOS.
There's this GitHub project: https://github.com/feuvan/opencore-amr-iOS that build opencore amr for iOS, so please check that out.