diff --git a/cmake/macros/TargetWebRTC.cmake b/cmake/macros/TargetWebRTC.cmake index e117011101..fd5db5fcbe 100644 --- a/cmake/macros/TargetWebRTC.cmake +++ b/cmake/macros/TargetWebRTC.cmake @@ -5,12 +5,19 @@ # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html # macro(TARGET_WEBRTC) + if (ANDROID) + include(SelectLibraryConfigurations) + set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/webrtc/webrtc) + set(WEBRTC_INCLUDE_DIRS "${INSTALL_DIR}/include/webrtc") + set(WEBRTC_LIBRARY_DEBUG ${INSTALL_DIR}/debug/lib/libwebrtc.a) + set(WEBRTC_LIBRARY_RELEASE ${INSTALL_DIR}/lib/libwebrtc.a) + select_library_configurations(WEBRTC) + else() + set(WEBRTC_INCLUDE_DIRS "${VCPKG_INSTALL_ROOT}/include/webrtc") + find_library(WEBRTC_LIBRARY NAMES webrtc PATHS ${VCPKG_INSTALL_ROOT}/lib/ NO_DEFAULT_PATH) + endif() -if (ANDROID) -else() - target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${VCPKG_INSTALL_ROOT}/include/webrtc") - find_library(WEBRTC_LIBRARY NAMES webrtc PATHS ${VCPKG_INSTALL_ROOT}/lib/ NO_DEFAULT_PATH) + target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${WEBRTC_INCLUDE_DIRS}) target_link_libraries(${TARGET_NAME} ${WEBRTC_LIBRARY}) -endif() endmacro() diff --git a/cmake/ports/hifi-deps/CONTROL b/cmake/ports/hifi-deps/CONTROL index 2441de9002..0a3d194ea1 100644 --- a/cmake/ports/hifi-deps/CONTROL +++ b/cmake/ports/hifi-deps/CONTROL @@ -1,4 +1,4 @@ Source: hifi-deps Version: 0.1 Description: Collected dependencies for High Fidelity applications -Build-Depends: bullet3, draco, etc2comp, glm, nvtt, openexr (!android), openssl (windows), tbb (!android&!osx), zlib, webrtc (!android) +Build-Depends: bullet3, draco, etc2comp, glm, nvtt, openexr (!android), openssl (windows), tbb (!android&!osx), zlib, webrtc diff --git a/cmake/ports/webrtc/portfile.cmake b/cmake/ports/webrtc/portfile.cmake index 85479d4201..3f2fb7a6ab 100644 --- a/cmake/ports/webrtc/portfile.cmake +++ b/cmake/ports/webrtc/portfile.cmake @@ -2,11 +2,13 @@ include(vcpkg_common_functions) set(WEBRTC_VERSION 20190626) set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src) -if (WIN32) +if (ANDROID) + # this is handled by hifi_android.py +elseif (WIN32) vcpkg_download_distfile( WEBRTC_SOURCE_ARCHIVE URLS https://hifi-public.s3.amazonaws.com/seth/webrtc-20190626-windows.zip - SHA512 f4444a95f87800b446d95a4c381b69a8ddc36d89a08ce57bf2b03d684ce528b592a3260ef2f9dee314e38b58dd236a3495677e1c7773ce3d4057f59e80b48f32 + SHA512 c0848eddb1579b3bb0496b8785e24f30470f3c477145035fd729264a326a467b9467ae9f426aa5d72d168ad9e9bf2c279150744832736bdf39064d24b04de1a3 FILENAME webrtc-20190626-windows.zip ) elseif (APPLE) @@ -16,13 +18,12 @@ elseif (APPLE) SHA512 fc70cec1b5ee87395137b7090f424e2fc2300fc17d744d5ffa1cf7aa0e0f1a069a9d72ba1ad2fb4a640ebeb6c218bda24351ba0083e1ff96c4a4b5032648a9d2 FILENAME webrtc-20190626-osx.tar.gz ) -elseif (ANDROID) -# then not desktop Linux else () + # else Linux desktop vcpkg_download_distfile( WEBRTC_SOURCE_ARCHIVE URLS https://hifi-public.s3.amazonaws.com/seth/webrtc-20190626-linux.tar.gz - SHA512 7e41c3350e4dd3bbbedff9070ef0887db4e8d1607270ac2057cee3c8c2bf17aa2bdccb6c1bfa14526338a51b57d7896b7e1230c6cedb41f3afe5c49a5f1a7319 + SHA512 07d7776551aa78cb09a3ef088a8dee7762735c168c243053b262083d90a1d258cec66dc386f6903da5c4461921a3c2db157a1ee106a2b47e7756cb424b66cc43 FILENAME webrtc-20190626-linux.tar.gz ) endif () diff --git a/hifi_android.py b/hifi_android.py index 42b472e960..926a671a6c 100644 --- a/hifi_android.py +++ b/hifi_android.py @@ -94,6 +94,11 @@ ANDROID_PACKAGES = { 'checksum': 'ddcb23df336b08017042ba4786db1d9e', 'sharedLibFolder': 'lib', 'includeLibs': {'libbreakpad_client.a'} + }, + 'webrtc': { + 'file': 'webrtc-20190626-android.tar.gz', + 'checksum': '8be046cf27e1fabff8a1029eabbe52c8', + 'versionId': '8TU1LgZswAgZpBiNYvB5s3ZLwSqNJHuj', } } diff --git a/libraries/shared/src/shared/WebRTC.h b/libraries/shared/src/shared/WebRTC.h index 3085f46c0a..6f05d38a3d 100644 --- a/libraries/shared/src/shared/WebRTC.h +++ b/libraries/shared/src/shared/WebRTC.h @@ -14,13 +14,14 @@ #if defined(Q_OS_MAC) # define WEBRTC_ENABLED 1 # define WEBRTC_POSIX 1 -#elif defined(WIN32) +#elif defined(Q_OS_WIN) # define WEBRTC_ENABLED 1 # define WEBRTC_WIN 1 # define NOMINMAX 1 # define WIN32_LEAN_AND_MEAN 1 #elif defined(Q_OS_ANDROID) -// no webrtc for android -- this is here so the LINUX clause doesn't get used, below +# define WEBRTC_ENABLED 1 +# define WEBRTC_POSIX 1 #elif defined(Q_OS_LINUX) # define WEBRTC_ENABLED 1 # define WEBRTC_POSIX 1