https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_SYSROOT.html
The value of this variable should be set prior to the first project() or enable_language() command invocation because it may influence configuration of the toolchain and flags.
https://devtalk.blender.org/t/cmath-issues-when-building-in-xcode-mac-os/18130