dislocker
dislocker copied to clipboard
Fix for macOS build failing on Monterey (#278)
Fixed an issue in cmake/FindPolarSSL.cmake where the system's C compiler would be called directly without the shim to provide access to standard system libraries. With this fix, building on macOS no longer fails to find stdio.h ;)
In Big Sur and Monterey, standard include and library directories are not automatically divined by /Library/Developer/CommandLineTools/usr/bin/cc
and they are instead specified by the shim at /usr/bin/cc
. I recommend just using the normal system cc
as the macOS developers intended.
The best alternative approach would be to add build flags specifying -Wno-nullability-completeness -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
(the -Wno-nullability-completeness
is to turn off a large number of warnings for stdio.h
and - I imagine - many other standard headers).

TBH I don't have such OS to test it on, so I'll merge this and have faith with you :) Thanks for this contribution!