With the latest Xcode (26.0.1) and the latest release of JUCE (8.0.10) there’s a build warning whenever juce_recommended_warning_flags and juce_gui_basics are linked to any gui app:
/Users/eyalamir/Code/Sophistidating/cmake-build-debug/_deps/juce-src/modules/juce_gui_basics/native/juce_NSViewComponentPeer_mac.mm:1923:17: warning: enumeration value ‘NSEventTypeMouseCancelled’ not explicitly handled in switch [-Wswitch-enum]1923 | switch ([e type])|
I updated both yesterday and I’m also seeing the warning. I’m not 100% sure what the fix is yet though. We already added the switch case
#if JUCE_MAC_API_VERSION_CAN_BE_BUILT (26, 0)
case NSEventTypeMouseCancelled:
#endif
However, JUCE_MAC_API_VERSION_CAN_BE_BUILT relies on MAC_OS_X_VERSION_MAX_ALLOWED which is set as follows.
/*
* if max OS not specified, assume larger of (10.15, min)
*/
#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_14_0
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED
#else
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_14_0
#endif
#endif
So for me at least MAC_OS_X_VERSION_MAX_ALLOWED ends up set to MAC_OS_VERSION_14_0 (14), rather than 26.
Historically I don’t think we’ve ever had to set this preprocessor definition ourselves, I assume Xcode has set it in the past but I haven’t taken a closer look to be honest.
Yeah I had the same - seemed weird to me that the min and max would be set to the same version. I think I may have just brute-forced it and set the max to some suitably large value.
Indeed I’m using MacOS 15.6.1 and not the latest, In my case, I have a minimum requirement of MacOS 11, but I’ve seen this warning in different projects with different target OS requirement.
Ive been having that same issue. Im still on macos 15, not upgrading to the 26 version yet but xcode automatically did update and I honestly don’t like it. it breaks alot of things, namely gcc flags on the app
I do have a fix incoming for this but for some reason it didn’t make it through our CI yesterday.
As far as I can tell MAC_OS_X_VERSION_MAX_ALLOWED is broken (I’ll likely report that to Apple) but internally Apple rely on __MAC_OS_X_VERSION_MAX_ALLOWED so for now I’ve switched to relying on that instead.