facebookincubator / SocketRocket

A conforming Objective-C WebSocket client library.
Other
9.54k stars 2.01k forks source link

Compilation issue on macCatalyst #640

Open vincentjames501 opened 2 years ago

vincentjames501 commented 2 years ago

It looks like TARGET_OS_IPHONE is by default set when targeting macCatalyst:

https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets/49560690#49560690

Because of this, we get a compilation issue in SRWebSocket.m with #import <unicode/utf8.h> could not be found when trying to target Catalyst.

Should we change it to:

#if !(TARGET_OS_MACCATALYST)
  #if TARGET_OS_IOS
    #define HAS_ICU
  #endif
#endif

I'm not sure what this would break or if there is a better alternative.

mattyancheksonos commented 2 years ago

I am running into this issue as well for a ReactNative app in which we support Mac Catalyst. Note this issue only surfaced after upgrading from ReactNative 0.68 to 0.69.