diff options
author | Roxie Linden <roxie@lindenlab.com> | 2023-09-08 21:36:17 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-08 18:34:00 -0800 |
commit | a80f6070a2c80ad2798da240254da8d8a4f5f993 (patch) | |
tree | be8d4ca54f423f4f0addb33293a7cf6d0ae108dc | |
parent | 0ae8bbaf5d85b065354dcc010d08a4a2e759f867 (diff) |
Pull webrtc down from a webserver before building.
-rw-r--r-- | indra/cmake/WebRTC.cmake | 68 | ||||
-rw-r--r-- | indra/llwebrtc/CMakeLists.txt | 6 |
2 files changed, 37 insertions, 37 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") + diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index c0e2520a22..881a3af607 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_GENERATOR_TOOLSET "clang_cl_x64") +#set(CMAKE_GENERATOR_TOOLSET "clang-cl") include(00-Common) include(Linking) @@ -20,6 +20,7 @@ message(STATUS "SharedLib: ${SHARED_LIB_STAGING_DIR}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi") + set(llwebrtc_SOURCE_FILES llwebrtc.cpp ) @@ -46,7 +47,8 @@ target_link_libraries(llwebrtc PRIVATE ll::webrtc iphlpapi) target_include_directories( llwebrtc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -set_property(TARGET llwebrtc PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDebug") +set_property(TARGET llwebrtc PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreadedDebug") install(TARGETS llwebrtc RUNTIME DESTINATION "${CMAKE_BINARY_DIR}/sharedlibs/RelWithDebInfo") |