dislocker icon indicating copy to clipboard operation
dislocker copied to clipboard

Fix for macOS build failing on Monterey (#278)

Open torstenvl opened this issue 2 years ago • 2 comments

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 ;)

torstenvl avatar Jul 30 '22 21:07 torstenvl

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).

 2022-08-01 at 1308  SS

torstenvl avatar Aug 02 '22 03:08 torstenvl

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!

Aorimn avatar Sep 14 '22 09:09 Aorimn