Skip to content

Commit

Permalink
Update webrtc (#749)
Browse files Browse the repository at this point in the history
* link with clang lld
  • Loading branch information
mpromonet authored Jan 4, 2025
1 parent a6e4711 commit ba52b14
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project (webrtc-streamer)
set (WEBRTCROOT "${CMAKE_CURRENT_SOURCE_DIR}/../webrtc" CACHE STRING "WEBRTC root directory")
set (WEBRTCDESKTOPCAPTURE "ON" CACHE STRING "WEBRTC Desktop capture")
set (WEBRTCCHROMEBRANDED "ON" CACHE STRING "WEBRTC Chrome branded")
set (WEBRTCVERSION "b00c469cad3f8c926fcf81ded90b90b6e1e62b9c" CACHE STRING "WEBRTC version")
set (WEBRTCVERSION "549c9b717fcbdfdf5d76068b3dd37076a9ffeacb" CACHE STRING "WEBRTC version")

if(NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "Release")
Expand Down Expand Up @@ -82,7 +82,7 @@ if (NOT EXISTS ${WEBRTCOBJS}/${CMAKE_STATIC_LIBRARY_PREFIX}webrtc${CMAKE_STATIC_
endif()


set (WEBRTCARGS rtc_include_tests=false\nrtc_enable_protobuf=false\nrtc_build_examples=false\nrtc_build_tools=false\ntreat_warnings_as_errors=false\nenable_js_protobuf=false\nuse_glib=false\nuse_lld=false\n)
set (WEBRTCARGS rtc_include_tests=false\nrtc_enable_protobuf=false\nrtc_build_examples=false\nrtc_build_tools=false\ntreat_warnings_as_errors=false\nenable_js_protobuf=false\nuse_glib=false\n)
set (WEBRTCARGS use_custom_libcxx=false\nlibyuv_use_sme=false\n${WEBRTCARGS})
# debug/release
if(CMAKE_BUILD_TYPE STREQUAL "Release")
Expand Down Expand Up @@ -115,9 +115,9 @@ if (NOT EXISTS ${WEBRTCOBJS}/${CMAKE_STATIC_LIBRARY_PREFIX}webrtc${CMAKE_STATIC_
endif()

#patch
file(READ ${WEBRTCROOT}/src/rtc_base/ssl_stream_adapter.h filecontent)
string(REPLACE "#include <vector>" "#include <vector>\n#include <optional>" filecontent "${filecontent}")
file(WRITE ${WEBRTCROOT}/src/rtc_base/ssl_stream_adapter.h "${filecontent}")
file(READ ${WEBRTCROOT}/src/third_party/perfetto/include/perfetto/tracing/track.h filecontent)
string(REPLACE "#include <map>" "#include <map>\n#include <optional>" filecontent "${filecontent}")
file(WRITE ${WEBRTCROOT}/src/third_party/perfetto/include/perfetto/tracing/track.h "${filecontent}")

file(READ ${WEBRTCROOT}/src/media/base/media_channel.h filecontent)
string(REGEX REPLACE "ost << ToStringIfSet[^;]*;" "" filecontent "${filecontent}")
Expand Down Expand Up @@ -258,6 +258,9 @@ if (WIN32)
add_definitions(-DUSE_X11 -DHAVE_SOUND -D_WINSOCKAPI_)
target_link_libraries (${CMAKE_PROJECT_NAME} secur32 dmoguids wmcodecdspuuid strmiids msdmo winmm dxgi d3d11 iphlpapi dwmapi shcore)
elseif (APPLE)
# use lld to link
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -B${WEBRTCROOT}/src/third_party/llvm-build/Release+Asserts/bin")

# live555
add_definitions(-DNEED_XLOCALE_H=1)
# webrtc
Expand All @@ -276,6 +279,9 @@ elseif (APPLE)
target_link_libraries (${CMAKE_PROJECT_NAME} ${CORE_FOUNDATION} ${APPLICATION_SERVICES} ${CORE_SERVICES}
${CORE_AUDIO} ${AUDIO_TOOLBOX} ${IO_SURFACE} ${APP_KIT})
else()
# use lld to link
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -B${WEBRTCROOT}/src/third_party/llvm-build/Release+Asserts/bin")

# libv4l2cpp
add_definitions(-DHAVE_V4L2)
aux_source_directory(libv4l2cpp/src LIBSRC_FILES)
Expand Down

0 comments on commit ba52b14

Please sign in to comment.