Yeah, that’s exactly what’s happening.
Updating XCode blows away your
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
directory and makes a single directory containing only MacOSX12.0.sdk pointing at MacOSX.sdk.
This seems to suffer from a lack of libc++.dylib being present… Maybe due to something having to do with how Big Sur loads libraries (not sure if I understand it)?
https://developer.apple.com/forums/thread/666700
The following steps resolved it for me:
# cd `xcode-select -p`/
# cd Platforms/MacOSX.platform/Developer/SDKs/
# git clone https://github.com/phracker/MacOSX-SDKs.git
# cp -r MacOSX-SDKs/MacOSX11.3.sdk .
And then I made sure CMAKE_OSX_SYSROOT was pointing at:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk