Enable C++ exceptions for the main target on Mac, but not on Linux.