Skip to content

Commit

Permalink
Get steamwebrtc building successfully on macos
Browse files Browse the repository at this point in the history
Defining WEBRTC_MAC and including cocoa_threading.mm, etc. are crucial to getting steamwebrtc compiling successfully on macos.
  • Loading branch information
NatWeiss authored and zpostfacto committed Mar 13, 2024
1 parent 611cf27 commit 7f5457f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/external/steamwebrtc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ if(WIN32)
/wd4996 # src\external\webrtc\rtc_base\win32.cc(324): warning C4996: 'GetVersionExA': was declared deprecated
/wd4530 # C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\include\ostream(281): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
)
elseif(CMAKE_SYSTEM_NAME MATCHES Darwin)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined ")
add_definitions(
-DWEBRTC_POSIX
-DWEBRTC_MAC
)
else(WIN32)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined ")
add_definitions(
Expand Down Expand Up @@ -694,6 +700,18 @@ if(WIN32)
Secur32
Iphlpapi
)
elseif(CMAKE_SYSTEM_NAME MATCHES Darwin)
target_sources(webrtc-lite PRIVATE
${webrtc_SOURCE_DIR}/rtc_base/synchronization/rw_lock_posix.cc
${webrtc_SOURCE_DIR}/rtc_base/synchronization/rw_lock_posix.h
${webrtc_SOURCE_DIR}/rtc_base/system/cocoa_threading.mm
${webrtc_SOURCE_DIR}/rtc_base/mac_ifaddrs_converter.cc
${webrtc_SOURCE_DIR}/rtc_base/ifaddrs_converter.cc
)
target_link_libraries(webrtc-lite
pthread
)
target_compile_options(webrtc-lite PRIVATE -Wno-attributes)
else(WIN32)
target_sources(webrtc-lite PRIVATE
${webrtc_SOURCE_DIR}/rtc_base/synchronization/rw_lock_posix.cc
Expand Down

0 comments on commit 7f5457f

Please sign in to comment.