diff --git a/Library/TeamTalkLib/build/webrtc/CMakeLists.txt b/Library/TeamTalkLib/build/webrtc/CMakeLists.txt index 1260a3bbb5..ccb0b728d6 100644 --- a/Library/TeamTalkLib/build/webrtc/CMakeLists.txt +++ b/Library/TeamTalkLib/build/webrtc/CMakeLists.txt @@ -9,9 +9,19 @@ include(ExternalProject) set (TOOLCHAIN_INSTALL_PREFIX_WEBRTC ${TOOLCHAIN_INSTALL_PREFIX}/webrtc) if (MSVC) + # WebRTC for Windows depends on "Windows 11 SDK (10.0.22621.0)". This + # can be installed from Visual Studio Installer. + # + # WebRTC for Windows depends on "C++ Clang Compiler for Windows (18.1.8)". + # This can be installed from Visual Studio Installer. + # Force C:\webrtc to avoid build errors due to long path names (MAX_PATH=260) set (WEBRTC_FETCH_PATH C:/webrtc/${CMAKE_SYSTEM_NAME}) + file(TO_NATIVE_PATH ${WEBRTC_FETCH_PATH} WEBRTC_FETCH_PATH_NATIVE) + set (WEBRTC_SOURCE_ROOT ${WEBRTC_FETCH_PATH}/src) + file(TO_NATIVE_PATH ${WEBRTC_SOURCE_ROOT} WEBRTC_SOURCE_ROOT_NATIVE) + if (${CMAKE_SIZEOF_VOID_P} EQUAL 8) if (IS_ABSOLUTE ${TOOLCHAIN_INSTALL_PREFIX}) set (WEBRTC_INSTALL_ROOT ${TOOLCHAIN_INSTALL_PREFIX_WEBRTC}/x64) @@ -50,19 +60,20 @@ if (MSVC) ExternalProject_Get_Property(depot-tools SOURCE_DIR) set (DEPOTTOOLS_DIR ${SOURCE_DIR}) file (TO_NATIVE_PATH ${DEPOTTOOLS_DIR} DEPOTTOOLS_DIR_NATIVE) + configure_file(${CMAKE_CURRENT_LIST_DIR}/depottools-win.bat_sample ${CMAKE_CURRENT_BINARY_DIR}/depottools-win.bat @ONLY) if (NOT EXISTS ${WEBRTC_SOURCE_ROOT}) message (WARNING "WebRTC is not present in ${WEBRTC_SOURCE_ROOT}. Downloading... This takes a loooong time") - set (WEBRTC_FETCH_CMD1 SET DEPOT_TOOLS_WIN_TOOLCHAIN=0) - set (WEBRTC_FETCH_CMD2 SET PATH=${DEPOTTOOLS_DIR_NATIVE}$%PATH%$) - set (WEBRTC_FETCH_CMD3 cd ${WEBRTC_FETCH_PATH}) - set (WEBRTC_FETCH_CMD4 CALL fetch --nohooks webrtc) - set (WEBRTC_FETCH_CMD5 CALL gclient sync --with_branch_heads --with_tags) - set (WEBRTC_FETCH_CMD6 cd ${WEBRTC_SOURCE_ROOT}) - set (WEBRTC_FETCH_CMD7 CALL git checkout branch-heads/4332) - set (WEBRTC_FETCH_CMD8 CALL gclient sync -D) + set (WEBRTC_FETCH_CMD1 ${CMAKE_CURRENT_BINARY_DIR}/depottools-win.bat) + set (WEBRTC_FETCH_CMD2 echo "Skip WebRTC CMD") + set (WEBRTC_FETCH_CMD3 echo "Skip WebRTC CMD") + set (WEBRTC_FETCH_CMD4 echo "Skip WebRTC CMD") + set (WEBRTC_FETCH_CMD5 echo "Skip WebRTC CMD") + set (WEBRTC_FETCH_CMD6 echo "Skip WebRTC CMD") + set (WEBRTC_FETCH_CMD7 echo "Skip WebRTC CMD") + set (WEBRTC_FETCH_CMD8 echo "Skip WebRTC CMD") set (WEBRTC_PATCH_CMD1 cd ${WEBRTC_SOURCE_ROOT}) - set (WEBRTC_PATCH_CMD2 CALL git apply ${CMAKE_CURRENT_LIST_DIR}\\libteamtalk-r4332.patch) + set (WEBRTC_PATCH_CMD2 CALL git apply ${CMAKE_CURRENT_LIST_DIR}\\libteamtalk-r6818.patch) else() message (WARNING "WebRTC is already downloaded to ${WEBRTC_SOURCE_ROOT}. Skipping new fetch and patching") set (WEBRTC_FETCH_CMD1 echo "Skipping WebRTC fetching") @@ -76,11 +87,8 @@ if (MSVC) set (WEBRTC_PATCH_CMD2 echo "Skipping WebRTC patching") endif() - # WebRTC for Windows depends on Windows SDK v10.0.20348.0. This - # can be downloaded from Visual Studio Installer - configure_file(${CMAKE_CURRENT_LIST_DIR}/webrtc_cfg_win.bat_sample ${CMAKE_CURRENT_BINARY_DIR}/webrtc_cfg_win.bat) - + ExternalProject_Add(webrtc-src DOWNLOAD_COMMAND ${WEBRTC_FETCH_CMD1} COMMAND ${WEBRTC_FETCH_CMD2} @@ -97,7 +105,7 @@ if (MSVC) CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/webrtc_cfg_win.bat COMMAND cd ${WEBRTC_SOURCE_ROOT} COMMAND CALL gn gen \\lib\\debug - COMMAND CALL gn gen \\lib\\release + COMMAND CALL gn gen \\lib\\release BUILD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/webrtc_cfg_win.bat COMMAND CALL ninja -v -C \\lib\\debug teamtalk COMMAND CALL ninja -v -C \\lib\\release teamtalk @@ -111,7 +119,6 @@ if (MSVC) ) file(MAKE_DIRECTORY ${WEBRTC_INSTALL_ROOT}/include) - file(MAKE_DIRECTORY ${WEBRTC_INSTALL_ROOT}/include/modules/audio_processing/include) file(MAKE_DIRECTORY ${WEBRTC_INSTALL_ROOT}/include/third_party/abseil-cpp) endif() @@ -122,7 +129,6 @@ if (MSVC) endif() target_include_directories (webrtc INTERFACE ${WEBRTC_INSTALL_ROOT}/include - ${WEBRTC_INSTALL_ROOT}/include/modules/audio_processing/include ${WEBRTC_INSTALL_ROOT}/include/third_party/abseil-cpp) set_target_properties(webrtc PROPERTIES IMPORTED_LOCATION_DEBUG ${WEBRTC_INSTALL_ROOT}/lib/debug/obj/modules/audio_processing/teamtalk.lib @@ -134,7 +140,6 @@ if (MSVC) endif() target_include_directories (webrtc INTERFACE ${WEBRTC_INSTALL_ROOT}/include - ${WEBRTC_INSTALL_ROOT}/include/modules/audio_processing/include ${WEBRTC_INSTALL_ROOT}/include/third_party/abseil-cpp) set_target_properties(webrtc PROPERTIES IMPORTED_LOCATION_DEBUG ${WEBRTC_INSTALL_ROOT}/lib/debug/obj/modules/audio_processing/teamtalk.lib diff --git a/Library/TeamTalkLib/build/webrtc/README.md b/Library/TeamTalkLib/build/webrtc/README.md deleted file mode 100644 index c99acee50c..0000000000 --- a/Library/TeamTalkLib/build/webrtc/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Building WebRTC - -WebRTC is not built automatically by CMake because it comes with its -own repository and tools. Quite a few manual steps are needed to setup -and build WebRTC. - -### Build WebRTC for Windows - -Start a Visual Studio 2019 command prompt, either "x86 Native Tools -Command Prompt for VS 2019" or "x64 Native Tools Command Prompt for VS -2019" depending on the architecture to build for. - -In the command prompt first specify the location of the OpenSSL build -in an `OPENSSL_DIR` environment variable. - -Run `build_win.bat` and follow the instructions. diff --git a/Library/TeamTalkLib/build/webrtc/args.gn_win_debug b/Library/TeamTalkLib/build/webrtc/args.gn_win_debug index 6dc281b90d..397003fdee 100644 --- a/Library/TeamTalkLib/build/webrtc/args.gn_win_debug +++ b/Library/TeamTalkLib/build/webrtc/args.gn_win_debug @@ -1,6 +1,8 @@ enable_iterator_debugging=true -is_clang=false +is_clang=true is_debug=true +libsrtp_build_boringssl=false +libsrtp_ssl_root="" rtc_build_examples=false rtc_build_libvpx=false rtc_build_ssl=false @@ -12,6 +14,7 @@ rtc_exclude_field_trial_default=true rtc_include_opus=false rtc_include_tests=false rtc_libvpx_build_vp9=false -rtc_ssl_root="@OPENSSL_DIR@/include" +rtc_ssl_root="" target_cpu="@WEBRTC_ARCH@" use_custom_libcxx=false +use_lld=false diff --git a/Library/TeamTalkLib/build/webrtc/args.gn_win_release b/Library/TeamTalkLib/build/webrtc/args.gn_win_release index 962e31e6b5..9b2fe4c92c 100644 --- a/Library/TeamTalkLib/build/webrtc/args.gn_win_release +++ b/Library/TeamTalkLib/build/webrtc/args.gn_win_release @@ -1,5 +1,6 @@ -is_clang=false +is_clang=true is_debug=false +libsrtp_build_boringssl=false rtc_build_examples=false rtc_build_libvpx=false rtc_build_ssl=false @@ -11,6 +12,6 @@ rtc_exclude_field_trial_default=true rtc_include_opus=false rtc_include_tests=false rtc_libvpx_build_vp9=false -rtc_ssl_root="@OPENSSL_DIR@/include" target_cpu="@WEBRTC_ARCH@" use_custom_libcxx=false +use_lld=false diff --git a/Library/TeamTalkLib/build/webrtc/depottools-win.bat_sample b/Library/TeamTalkLib/build/webrtc/depottools-win.bat_sample new file mode 100644 index 0000000000..8fee39d72e --- /dev/null +++ b/Library/TeamTalkLib/build/webrtc/depottools-win.bat_sample @@ -0,0 +1,24 @@ +SET DEPOT_TOOLS_WIN_TOOLCHAIN=0 +IF NOT "%ERRORLEVEL%" == "0" GOTO fail +SET PATH=%PATH%;@DEPOTTOOLS_DIR_NATIVE@ +IF NOT "%ERRORLEVEL%" == "0" GOTO fail +CD @WEBRTC_FETCH_PATH_NATIVE@ +IF NOT "%ERRORLEVEL%" == "0" GOTO fail +fetch.bat --nohooks webrtc +IF NOT "%ERRORLEVEL%" == "0" GOTO fail +gclient sync --with_branch_heads --with_tags +IF NOT "%ERRORLEVEL%" == "0" GOTO fail + +cd @WEBRTC_SOURCE_ROOT_NATIVE@ +IF NOT "%ERRORLEVEL%" == "0" GOTO fail +git checkout branch-heads/6818 +IF NOT "%ERRORLEVEL%" == "0" GOTO fail +gclient sync -D +IF NOT "%ERRORLEVEL%" == "0" GOTO fail + +@ECHO Finished fetching WebRTC + +EXIT /B 0 + +:fail +EXIT /B 1 diff --git a/Library/TeamTalkLib/build/webrtc/webrtc_cfg_win.bat_sample b/Library/TeamTalkLib/build/webrtc/webrtc_cfg_win.bat_sample index d81a7842b6..c6f17693a6 100644 --- a/Library/TeamTalkLib/build/webrtc/webrtc_cfg_win.bat_sample +++ b/Library/TeamTalkLib/build/webrtc/webrtc_cfg_win.bat_sample @@ -1,2 +1,2 @@ SET DEPOT_TOOLS_WIN_TOOLCHAIN=0 -SET PATH=@DEPOTTOOLS_DIR_NATIVE@;%PATH% +SET PATH=%PATH%;@DEPOTTOOLS_DIR_NATIVE@