From 994039c948c29dc4664f7c2f2ec2c87001117234 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Fri, 8 Mar 2024 22:49:05 -0800 Subject: Use webrtc autobuild package --- indra/cmake/WebRTC.cmake | 50 ++++++++---------------------------------------- 1 file changed, 8 insertions(+), 42 deletions(-) (limited to 'indra') diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake index 4032398c01..909a1345ed 100644 --- a/indra/cmake/WebRTC.cmake +++ b/indra/cmake/WebRTC.cmake @@ -1,46 +1,15 @@ # -*- cmake -*- +include(Linking) +include(Prebuilt) -include(FetchContent) - -if (WINDOWS) - if( ADDRESS_SIZE EQUAL 32 ) - FetchContent_Declare( - webrtc - URL "https://webrtc-build-releases.s3.us-west-2.amazonaws.com/webrtc.windows_x86.tar.bz2" - URL_HASH "MD5=cefbd446b1b152ac08217fc78648fb99" - FIND_PACKAGE_ARGS NAMES webrtc - DOWNLOAD_EXTRACT_TIMESTAMP TRUE - DOWNLOAD_DIR "${LIBS_PREBUILT_DIR}/webrtc/" - ) - else ( ADDRESS_SIZE EQUAL 32 ) - FetchContent_Declare( - webrtc - URL "https://webrtc-build-releases.s3.us-west-2.amazonaws.com/webrtc.windows_x86_64.tar.bz2" - URL_HASH "MD5=6e25b99284215933ec1571b6e60c1030" - FIND_PACKAGE_ARGS NAMES webrtc - DOWNLOAD_EXTRACT_TIMESTAMP TRUE - DOWNLOAD_DIR "${LIBS_PREBUILT_DIR}/webrtc/" - ) - endif ( ADDRESS_SIZE EQUAL 32 ) -elseif (DARWIN) - FetchContent_Declare( - webrtc - URL "https://webrtc-build-releases.s3.us-west-2.amazonaws.com/webrtc.macos_x86_64.tar.bz2" - URL_HASH "MD5=6849e81773135290f5c70cbf679992fb" - FIND_PACKAGE_ARGS NAMES webrtc - DOWNLOAD_EXTRACT_TIMESTAMP TRUE - DOWNLOAD_DIR "${LIBS_PREBUILT_DIR}/webrtc/" - ) -endif (WINDOWS) - -FetchContent_MakeAvailable(webrtc) - -set(WEBRTC_PATH ${webrtc_SOURCE_DIR}) +include_guard() add_library( ll::webrtc INTERFACE IMPORTED ) +target_include_directories( ll::webrtc SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/webrtc" "${LIBS_PREBUILT_DIR}/include/webrtc/third_party/abseil-cpp") +use_prebuilt_binary(webrtc-shim) if (WINDOWS) - target_link_libraries( ll::webrtc INTERFACE "${WEBRTC_PATH}/lib/webrtc.lib" ) + target_link_libraries( ll::webrtc INTERFACE webrtc.lib ) elseif (DARWIN) FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio) FIND_LIBRARY(COREGRAPHICS_LIBRARY CoreGraphics) @@ -49,7 +18,7 @@ elseif (DARWIN) FIND_LIBRARY(COCOA_LIBRARY Cocoa) target_link_libraries( ll::webrtc INTERFACE - "${WEBRTC_PATH}/lib/libwebrtc.a" + libwebrtc.a ${COREAUDIO_LIBRARY} ${AUDIOTOOLBOX_LIBRARY} ${COREGRAPHICS_LIBRARY} @@ -57,10 +26,7 @@ elseif (DARWIN) ${COCOA_LIBRARY} ) elseif (LINUX) - target_link_libraries( ll::webrtc INTERFACE "${WEBRTC_PATH}/lib/libwebrtc.a" ) + target_link_libraries( ll::webrtc INTERFACE libwebrtc ) endif (WINDOWS) -message("PATH: ${WEBRTC_PATH}/include") - -target_include_directories( ll::webrtc INTERFACE "${WEBRTC_PATH}/include" "${WEBRTC_PATH}/include/third_party/abseil-cpp") -- cgit v1.2.3