diff --git a/.gitignore b/.gitignore index f5f42f1..6177a33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store /out/ /.idea/ *.gclient diff --git a/Samples/PeerConnection/CMakeLists.txt b/Samples/PeerConnection/CMakeLists.txt index bbc70a8..fcfd9b5 100644 --- a/Samples/PeerConnection/CMakeLists.txt +++ b/Samples/PeerConnection/CMakeLists.txt @@ -4,9 +4,17 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) if(UNIX AND NOT APPLE) - find_package(X11 REQUIRED) + find_package(X11 REQUIRED) 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 main.cpp Core.cpp @@ -54,8 +62,14 @@ elseif(UNIX AND NOT APPLE) set(PEERCONNECTION_LIBRARIES ${PEERCONNECTION_LIBRARIES} ${X11_LIBRARIES} ${CMAKE_DL_LIBS}) +elseif(APPLE) + set(PEERCONNECTION_LIBRARIES ${PEERCONNECTION_LIBRARIES} + ${AUDIOTOOLBOX_LIBRARY} ${COREAUDIO_LIBRARY} ${COREFOUNDATION_LIBRARY} + ${COREGRAPHICS_LIBRARY} ${FOUNDATION_LIBRARY}) 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) \ No newline at end of file +target_link_libraries(PeerConnection ${PEERCONNECTION_LIBRARIES}) +add_dependencies(PeerConnection libwebrtc) \ No newline at end of file diff --git a/Samples/PeerConnection/UnixConsole.cpp b/Samples/PeerConnection/UnixConsole.cpp index dea6fd3..a0ac439 100644 --- a/Samples/PeerConnection/UnixConsole.cpp +++ b/Samples/PeerConnection/UnixConsole.cpp @@ -150,4 +150,4 @@ void Console::Back() write(STDOUT_FILENO, &key, 1); key = '\b'; write(STDOUT_FILENO, &key, 1); -} \ No newline at end of file +} diff --git a/Samples/PeerConnection/main.cpp b/Samples/PeerConnection/main.cpp index 896c2d1..6022b2c 100644 --- a/Samples/PeerConnection/main.cpp +++ b/Samples/PeerConnection/main.cpp @@ -18,7 +18,7 @@ void HandleSDP(Json::Value object) { webrtc::CreateSessionDescription(type, sdp, &error)); 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; } @@ -38,7 +38,7 @@ void HandleICECandidate(Json::Value object) { webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp, &error)); 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; } @@ -131,4 +131,4 @@ int main(int argc, char **argv) { Core::Cleanup(); Console::Cleanup(); return EXIT_SUCCESS; -} \ No newline at end of file +} diff --git a/Targets/WebRTC/CMakeLists.txt b/Targets/WebRTC/CMakeLists.txt index add83a7..000bb47 100644 --- a/Targets/WebRTC/CMakeLists.txt +++ b/Targets/WebRTC/CMakeLists.txt @@ -22,7 +22,7 @@ set(GCLIENT_SYNC_COMMAND set(SETUP_LINKS_COMMAND ${PYTHON_EXECUTABLE} src/setup_links.py) -ExternalProject_Add(webrtc +ExternalProject_Add(webrtc-src DEPENDS chromium PREFIX ${CMAKE_BINARY_DIR} @@ -72,7 +72,7 @@ add_libwebrtc_command(webrtc-generate "${LIBWEBRTC_GEN_CMD}" ${CMAKE_BINARY_DIR}/src "Generating build files" - webrtc) + webrtc-src) # # Update clang diff --git a/Targets/libwebrtc/CMakeLists.txt b/Targets/libwebrtc/CMakeLists.txt index 5eefdbd..e784d6d 100644 --- a/Targets/libwebrtc/CMakeLists.txt +++ b/Targets/libwebrtc/CMakeLists.txt @@ -12,8 +12,8 @@ if (WIN32) elseif (UNIX AND NOT APPLE) set(LIBWEBRTC_OBJ_EXT o) elseif (APPLE) - set(LIBWEBRTC_OBJ_EXT a) -endif (WIN32) + set(LIBWEBRTC_OBJ_EXT o) +endif () file(GLOB_RECURSE LIBWEBRTC_OBJ_FILES ${LIBWEBRTC_OUTPUT_DIR}/obj/*.${LIBWEBRTC_OBJ_EXT}) @@ -41,7 +41,6 @@ set_target_properties(webrtc PROPERTIES LINKER_LANGUAGE C LIBRARY_OUTPUT_DIRECTORY ${LIBWEBRTC_OUTPUT_DIR}) - # # Install headers #