There seems to be a bug in cocos2d-x 4 and Xcode 12.5
The linker flags last two lines say:
/usr/lib/libz.dylib
/usr/lib/libiconv.dylib
This will result in an error:
clang: error: no such file or directory: '/usr/lib/libz.dylib'
clang: error: no such file or directory: '/usr/lib/libiconv.dylib'
To resolve this, I delete those two lines, and add the flags -lz and -liconv
This makes it compile. But every time I run:
cmake ../.. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos
to regenerate the XcodeProj file, I need to update the flags again. This is tedious. Is there a way to fix this, such as specifying something in cmakelists ?