SConstruct currently enforces a requirement of macOS 10.12 or later:
https://github.com/mongodb/mongo/blob/master/SConstruct#L2853-L2881
In fact, mongodb 5.0.0 appears to require macOS 10.13 or later; trying to compile on macOS 10.12 fails. There are many errors, beginning with:
src/mongo/logv2/plain_formatter.cpp:127:21: error: 'any_cast<const std::__1::basic_string<char> &>' is unavailable: introduced in macOS 10.13 return std::any_cast<const T&>(_storage.emplace_back(std::forward<T>(val))); ^ src/mongo/logv2/plain_formatter.cpp:122:31: note: in instantiation of function template specialization 'mongo::logv2::(anonymous namespace)::TextValueExtractor::_store<std::__1::basic_string<char> >' requested here _add(name, StringData{_store(std::move(val))}); ^ /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/any:596:12: note: 'any_cast<const std::__1::basic_string<char> &>' has been explicitly marked unavailable here _ValueType any_cast(any & __v) ^
Here is the full build log:
If you can continue to support macOS 10.12 that would be great. If not, you could update SConstruct to error out on macOS 10.12.