mirror of
https://github.com/UltraCoderRU/libwebrtc.git
synced 2026-01-28 11:15:13 +00:00
OSX: Fix sample and library definition
This commit is contained in:
parent
49ddc448d1
commit
1eda115a37
6 changed files with 26 additions and 12 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
|
.DS_Store
|
||||||
/out/
|
/out/
|
||||||
/.idea/
|
/.idea/
|
||||||
*.gclient
|
*.gclient
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,14 @@ if(UNIX AND NOT APPLE)
|
||||||
find_package(X11 REQUIRED)
|
find_package(X11 REQUIRED)
|
||||||
endif(UNIX AND NOT APPLE)
|
endif(UNIX AND NOT APPLE)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
||||||
|
find_library(COREAUDIO_LIBRARY CoreAudio)
|
||||||
|
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||||
|
find_library(COREGRAPHICS_LIBRARY CoreGraphics)
|
||||||
|
find_library(FOUNDATION_LIBRARY Foundation)
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
set(PEERCONNECTION_SOURCE_FILES
|
set(PEERCONNECTION_SOURCE_FILES
|
||||||
main.cpp
|
main.cpp
|
||||||
Core.cpp
|
Core.cpp
|
||||||
|
|
@ -54,8 +62,14 @@ elseif(UNIX AND NOT APPLE)
|
||||||
set(PEERCONNECTION_LIBRARIES ${PEERCONNECTION_LIBRARIES}
|
set(PEERCONNECTION_LIBRARIES ${PEERCONNECTION_LIBRARIES}
|
||||||
${X11_LIBRARIES}
|
${X11_LIBRARIES}
|
||||||
${CMAKE_DL_LIBS})
|
${CMAKE_DL_LIBS})
|
||||||
|
elseif(APPLE)
|
||||||
|
set(PEERCONNECTION_LIBRARIES ${PEERCONNECTION_LIBRARIES}
|
||||||
|
${AUDIOTOOLBOX_LIBRARY} ${COREAUDIO_LIBRARY} ${COREFOUNDATION_LIBRARY}
|
||||||
|
${COREGRAPHICS_LIBRARY} ${FOUNDATION_LIBRARY})
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
target_link_libraries(PeerConnection ${PEERCONNECTION_LIBRARIES})
|
add_library(webrtc STATIC IMPORTED)
|
||||||
|
set_property(TARGET webrtc PROPERTY IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/libwebrtc/${LIBWEBRTC_LIBRARY_NAME}")
|
||||||
|
|
||||||
add_dependencies(PeerConnection libwebrtc_merge)
|
target_link_libraries(PeerConnection ${PEERCONNECTION_LIBRARIES})
|
||||||
|
add_dependencies(PeerConnection libwebrtc)
|
||||||
|
|
@ -18,7 +18,7 @@ void HandleSDP(Json::Value object) {
|
||||||
webrtc::CreateSessionDescription(type, sdp, &error));
|
webrtc::CreateSessionDescription(type, sdp, &error));
|
||||||
|
|
||||||
if (!desc) {
|
if (!desc) {
|
||||||
Console::Print("Can't parse the SDP: %s", error.description);
|
Console::Print("Can't parse the SDP: %s", error.description.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ void HandleICECandidate(Json::Value object) {
|
||||||
webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp, &error));
|
webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp, &error));
|
||||||
|
|
||||||
if (!candidate.get()) {
|
if (!candidate.get()) {
|
||||||
Console::Print("Can't parse the ICE candidate: %s", error.description);
|
Console::Print("Can't parse the ICE candidate: %s", error.description.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ set(GCLIENT_SYNC_COMMAND
|
||||||
|
|
||||||
set(SETUP_LINKS_COMMAND ${PYTHON_EXECUTABLE} src/setup_links.py)
|
set(SETUP_LINKS_COMMAND ${PYTHON_EXECUTABLE} src/setup_links.py)
|
||||||
|
|
||||||
ExternalProject_Add(webrtc
|
ExternalProject_Add(webrtc-src
|
||||||
DEPENDS chromium
|
DEPENDS chromium
|
||||||
|
|
||||||
PREFIX ${CMAKE_BINARY_DIR}
|
PREFIX ${CMAKE_BINARY_DIR}
|
||||||
|
|
@ -72,7 +72,7 @@ add_libwebrtc_command(webrtc-generate
|
||||||
"${LIBWEBRTC_GEN_CMD}"
|
"${LIBWEBRTC_GEN_CMD}"
|
||||||
${CMAKE_BINARY_DIR}/src
|
${CMAKE_BINARY_DIR}/src
|
||||||
"Generating build files"
|
"Generating build files"
|
||||||
webrtc)
|
webrtc-src)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Update clang
|
# Update clang
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ if (WIN32)
|
||||||
elseif (UNIX AND NOT APPLE)
|
elseif (UNIX AND NOT APPLE)
|
||||||
set(LIBWEBRTC_OBJ_EXT o)
|
set(LIBWEBRTC_OBJ_EXT o)
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
set(LIBWEBRTC_OBJ_EXT a)
|
set(LIBWEBRTC_OBJ_EXT o)
|
||||||
endif (WIN32)
|
endif ()
|
||||||
|
|
||||||
file(GLOB_RECURSE LIBWEBRTC_OBJ_FILES
|
file(GLOB_RECURSE LIBWEBRTC_OBJ_FILES
|
||||||
${LIBWEBRTC_OUTPUT_DIR}/obj/*.${LIBWEBRTC_OBJ_EXT})
|
${LIBWEBRTC_OUTPUT_DIR}/obj/*.${LIBWEBRTC_OBJ_EXT})
|
||||||
|
|
@ -41,7 +41,6 @@ set_target_properties(webrtc PROPERTIES
|
||||||
LINKER_LANGUAGE C
|
LINKER_LANGUAGE C
|
||||||
LIBRARY_OUTPUT_DIRECTORY ${LIBWEBRTC_OUTPUT_DIR})
|
LIBRARY_OUTPUT_DIRECTORY ${LIBWEBRTC_OUTPUT_DIR})
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install headers
|
# Install headers
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue