[ZLMediaKit]MacOS编译修改

作者: _小老虎_ | 来源:发表于2021-11-03 22:10 被阅读0次

    ZLMediaKit Mac编译方式(敏捷)

    修改CmakeList.txt

    注释rtc部分

    #if (ENABLE_WEBRTC)
    #    #查找srtp是否安装
    #    find_package(SRTP QUIET)
    #    if (SRTP_FOUND)
    #        message(STATUS "found library:${SRTP_LIBRARIES}")
    #        include_directories(${SRTP_INCLUDE_DIRS})
    #        list(APPEND LINK_LIB_LIST ${SRTP_LIBRARIES})
    
    #        add_definitions(-DENABLE_WEBRTC)
    #        include_directories(./webrtc)
    #        file(GLOB SRC_WEBRTC_LIST ./webrtc/*.cpp ./webrtc/*.h ./webrtc/*.hpp)
    #        add_library(webrtc ${SRC_WEBRTC_LIST})
    #        list(APPEND LINK_LIB_LIST webrtc)
    #        message(STATUS "webrtc功能已开启")
    #    else ()
    #        set(ENABLE_WEBRTC off)
    #        message(WARNING "srtp未找到, webrtc相关功能打开失败")
    #    endif ()
    #endif ()
    

    注释openssl部分

    #查找openssl是否安装
    #find_package(OpenSSL QUIET)
    #if (OPENSSL_FOUND AND ENABLE_OPENSSL)
    #    message(STATUS "found library:${OPENSSL_LIBRARIES},ENABLE_OPENSSL defined")
    #    include_directories(${OPENSSL_INCLUDE_DIR})
    #    add_definitions(-DENABLE_OPENSSL)
    #    list(APPEND LINK_LIB_LIST ${OPENSSL_LIBRARIES})
    #    if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND OPENSSL_USE_STATIC_LIBS)
    #        list(APPEND LINK_LIB_LIST dl)
    #    endif ()
    #else ()
    #    message(WARNING "openssl未找到,rtmp将不支持flash播放器,https/wss/rtsps/rtmps也将失效")
    #endif ()
    

    关闭rtc/openssl

    option(ENABLE_HLS "Enable HLS" true)
    option(ENABLE_OPENSSL "Enable OpenSSL" false) # 这里
    option(ENABLE_MYSQL "Enable MySQL" false)
    option(ENABLE_FAAC "Enable FAAC" false)
    option(ENABLE_X264 "Enable x264" false)
    option(ENABLE_MP4 "Enable MP4" true)
    option(ENABLE_RTPPROXY "Enable RTPPROXY" true)
    option(ENABLE_API "Enable C API SDK" true)
    option(ENABLE_CXX_API "Enable C++ API SDK" false)
    option(ENABLE_TESTS "Enable Tests" true)
    option(ENABLE_SERVER "Enable Server" true)
    option(ENABLE_MEM_DEBUG "Enable Memory Debug" false)
    option(ENABLE_ASAN "Enable Address Sanitize" false)
    option(ENABLE_WEBRTC "Enable WebRTC" false) # 这里
    option(ENABLE_PLAYER "Enable Player" true)
    option(ENABLE_MSVC_MT "Enable MSVC Mt/Mtd lib" true)
    option(ENABLE_API_STATIC_LIB "Enable mk_api static lib" false)
    
    单测去掉rtp部分
    • 进入 ZLMediaKit/tests

    • mv test_rtcp_nack.cpp ..

    开始编译
    cd ZLMediaKit
    mkdir build
    cd build
    cmake ..
    make -j4
    

    相关文章

      网友评论

        本文标题:[ZLMediaKit]MacOS编译修改

        本文链接:https://www.haomeiwen.com/subject/enzczltx.html