diff options
author | Roxie Linden <roxie@lindenlab.com> | 2023-09-08 21:36:17 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-22 23:11:33 -0800 |
commit | 0e46396429c1cd9b188d0493be2fef93ad145920 (patch) | |
tree | 3beebeca6697eebefd3d3dcaf2983a6dc5ce9963 /indra/cmake | |
parent | bf58173656b94243df835d29f6d5a7c4467d4d1e (diff) |
Pull webrtc down from a webserver before building.
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/WebRTC.cmake | 68 |
1 files changed, 33 insertions, 35 deletions
diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake index f8ce9c8104..7953d1ee1b 100644 --- a/indra/cmake/WebRTC.cmake +++ b/indra/cmake/WebRTC.cmake @@ -1,43 +1,41 @@ # -*- cmake -*- -include(CMakeCopyIfDifferent) -include(Linking) +include(FetchContent) -include_guard() - -set(WEBRTC_ROOT ${CMAKE_BINARY_DIR}/../../webrtc/src) -file(COPY ${WEBRTC_ROOT}/out/Default/obj/webrtc.lib - DESTINATION ${CMAKE_BINARY_DIR}/packages/lib/release +if (WINDOWS) +FetchContent_Declare( + webrtc + URL http://localhost:8000/webrtc.windows_x86_64.tar.bz2 + URL_HASH MD5=dfb692562770dc8c877ebfe4302e2881 + FIND_PACKAGE_ARGS NAMES webrtc + DOWNLOAD_EXTRACT_TIMESTAMP TRUE + DOWNLOAD_DIR "${LIBS_PREBUILT_DIR}/webrtc/" ) -set(WEBRTC_INCLUDE_DIR ${CMAKE_BINARY_DIR}/packages/include/webrtc) -file(MAKE_DIRECTORY ${WEBRTC_INCLUDE_DIR}) - -file(COPY ${WEBRTC_ROOT}/api - ${WEBRTC_ROOT}/media/base - ${WEBRTC_ROOT}/media/engine - ${WEBRTC_ROOT}/rtc_base - ${WEBRTC_ROOT}/pc - ${WEBRTC_ROOT}/p2p - ${WEBRTC_ROOT}/call - ${WEBRTC_ROOT}/media - ${WEBRTC_ROOT}/system_wrappers - ${WEBRTC_ROOT}/common_video - ${WEBRTC_ROOT}/video - ${WEBRTC_ROOT}/common_audio - ${WEBRTC_ROOT}/logging - ${WEBRTC_ROOT}/third_party/abseil-cpp/absl - DESTINATION ${WEBRTC_INCLUDE_DIR} - FILES_MATCHING PATTERN "*.h" +elseif (DARWIN) +FetchContent_Declare( + webrtc + URL http://localhost:8000/webrtc.macos_x86_64.tar.bz2 + URL_HASH MD5=cfbcac7da897a862f9791ea29330b814 + 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}) -add_library(ll::webrtc STATIC IMPORTED) -if (LINUX) - target_link_libraries( ll::webrtc INTERFACE ../webrtc/src/obj/Default/webrtc) +add_library( ll::webrtc INTERFACE IMPORTED ) + + +if (WINDOWS) + target_link_libraries( ll::webrtc INTERFACE "${WEBRTC_PATH}/lib/webrtc.lib" ) elseif (DARWIN) - target_link_libraries( ll::webrtc INTERFACE ../webrtc/src/obj/Default/webrtc) -elseif (WINDOWS) - set_target_properties( ll::webrtc PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/packages/lib/release/webrtc.lib) - target_link_libraries( ll::webrtc INTERFACE ${CMAKE_BINARY_DIR}/packages/lib/release/webrtc.lib) -endif (LINUX) -target_include_directories( ll::webrtc INTERFACE "${WEBRTC_INCLUDE_DIR}") + target_link_libraries( ll::webrtc INTERFACE "${WEBRTC_PATH}/lib/webrtc.a" ) +elseif (LINUX) + target_link_libraries( ll::webrtc INTERFACE "${WEBRTC_PATH}/lib/webrtc.a" ) +endif (WINDOWS) +target_include_directories( ll::webrtc SYSTEM INTERFACE "${WEBRTC_PATH}/include" "${WEBRTC_PATH}/include/third_party/abseil-cpp") + |