WonderInventions / node-webrtc

node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M98
Other
120 stars 9 forks source link

Error while building from source #18

Open g7i opened 4 months ago

g7i commented 4 months ago

I'm getting the following error while building from source on Mac M2


../../download/src/rtc_base/async_resolver.cc:60:3: error: 'dispatch_queue_global_t' is only available on macOS 10.14 or newer [-Werror,-Wunguarded-availability-new]
  dispatch_queue_global_t global_queue =
  ^~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/dispatch/queue.h:103:1: note: 'dispatch_queue_global_t' has been marked as being introduced in macOS 10.14 here, but the deployment target is macOS 10.11.0
DISPATCH_DECL_SUBCLASS(dispatch_queue_global, dispatch_queue);
^
../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/dispatch/object.h:117:49: note: expanded from macro 'DISPATCH_DECL_SUBCLASS'
                typedef struct name##_s : public base##_s {} *name##_t
                                                              ^
<scratch space>:98:1: note: expanded from here
dispatch_queue_global_t
^
../../download/src/rtc_base/async_resolver.cc:60:3: note: enclose 'dispatch_queue_global_t' in a __builtin_available check to silence this warning
  dispatch_queue_global_t global_queue =
  ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

clang

Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
duvallj commented 4 months ago

It seems like libwebrtc is being built with the wrong MacOS SDK. I haven't found a great way to configure it, so I just make my SDKs directory look like this:

> ls -la /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
lrwxr-xr-x - root 12 Jun 14:14 MacOSX11.3.sdk -> /Users/jackduvall/macos-sdk/MacOSX11.3.sdk
drwxr-xr-x - root 12 Jun 14:13 MacOSX14.5.sdk
lrwxr-xr-x - root 12 Jun 14:13 MacOSX14.sdk -> MacOSX14.5.sdk

Might interfere if you have other XCode projects tho, sorry about the weird build process...