Skip to content

Commit

Permalink
更新QTDemo配置文件, 适配最新TRTC SDK 编译
Browse files Browse the repository at this point in the history
  • Loading branch information
xushengxue authored and AbySwifter committed Jun 20, 2024
1 parent 7b1578a commit af2d3dd
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 54 deletions.
95 changes: 43 additions & 52 deletions Mac/QTDemo/QTDemo.pro
Original file line number Diff line number Diff line change
Expand Up @@ -162,77 +162,68 @@ macx {
INCLUDEPATH += $${SOURCE_PATHS}
DEPENDPATH += $${SOURCE_PATHS}

QMAKE_INFO_PLIST += Info.plist

# 添加TXLiteAVSDK_TRTC_Mac.framework头文件
INCLUDEPATH += $$PWD/../SDK/TXLiteAVSDK_TRTC_Mac.framework/Headers/cpp_interface
INCLUDEPATH += $$PWD/../SDK/TXLiteAVSDK_TRTC_Mac.framework/Headers
SOURCES += \
$$PWD/src/Util/mac/cdnplayer/tx_liveplayer_proxy.mm
INCLUDEPATH += $$PWD/src/Util/mac/usersig/include
DEPENDPATH += $$PWD/src/Util/mac/usersig/include

# 添加库依赖
LIBS += "-F$$PWD/../SDK"
LIBS += -framework TXLiteAVSDK_TRTC_Mac
LIBS += -L$$PWD/src/Util/mac/usersig/ -lTXLiteAVTestUserSig
PRE_TARGETDEPS += $$PWD/src/Util/mac/usersig/libTXLiteAVTestUserSig.a
DISTFILES += $$PWD/src/Util/mac/usersig/libTXLiteAVTestUserSig.a

# 引用的系统库
QMAKE_INFO_PLIST += Info.plist
QMAKE_CXXFLAGS += -x objective-c++
QMAKE_CXXFLAGS += -std=gnu++11
CONFIG += console

# 系统库
LIBS += -framework Accelerate
LIBS += -framework AudioUnit
LIBS += -lbz2
LIBS += -lresolv
LIBS += -framework AppKit
LIBS += -framework Foundation
LIBS += -framework CoreFoundation
LIBS += -framework Cocoa
LIBS += -framework Security
LIBS += -framework SystemConfiguration
LIBS += -framework JavaScriptCore
LIBS += -framework CoreMedia
LIBS += -framework CoreAudio
LIBS += -framework CoreVideo
LIBS += -framework CoreImage
LIBS += -framework CoreFoundation
LIBS += -framework AudioUnit
LIBS += -framework AVFoundation
LIBS += -framework AudioToolbox
LIBS += -framework VideoToolbox
LIBS += -framework MetalKit
LIBS += -framework Metal
LIBS += -framework CoreTelephony
LIBS += -framework CoreGraphics
LIBS += -framework OpenGL
LIBS += -framework OpenAL
LIBS += -framework CoreAudio
LIBS += -framework CoreMedia
LIBS += -framework CoreVideo
LIBS += -framework IOSurface
LIBS += -framework QuartzCore
LIBS += -framework SystemConfiguration
LIBS += -framework VideoToolBox
LIBS += -framework ScreenCaptureKit
LIBS += -framework CoreGraphics
LIBS += -lz
LIBS += -ObjC
# for x86_64
LIBS += -framework Metal
LIBS += -framework CoreGraphics
LIBS += -framework CoreText
LIBS += -framework CoCoa
LIBS += -framework CoreFoundation

TXLITEAVSDKDIR = $$PWD/../SDK/TXLiteAVSDK_TRTC_Mac.xcframework/macos-arm64_x86_64
TXFFMPEGDIR = $$PWD/../SDK/TXFFmpeg.xcframework/macos-arm64_x86_64
TXSOUNDTOUCHDIR = $$PWD/../SDK/TXSoundTouch.xcframework/macos-arm64_x86_64

# TXLiteAVSDK_TRTC_Mac
INCLUDEPATH += $${TXLITEAVSDKDIR}/TXLiteAVSDK_TRTC_Mac.framework/Headers
INCLUDEPATH += $${TXLITEAVSDKDIR}/TXLiteAVSDK_TRTC_Mac.framework/Headers/cpp_interface
LIBS += -F$${TXLITEAVSDKDIR} -framework TXLiteAVSDK_TRTC_Mac

# TXFFmpeg库的使用
LIBS += -F$$PWD/../SDK/TXFFmpeg.xcframework/macos-arm64_x86_64
LIBS += -framework TXFFmpeg
TXFFmpeg_FRAMEWORK.files = $$PWD/../SDK/TXFFmpeg.xcframework/macos-arm64_x86_64/TXFFmpeg.framework
# TXFFmpeg
LIBS += -F$${TXFFMPEGDIR} -framework TXFFmpeg
TXFFmpeg_FRAMEWORK.files = $${TXFFMPEGDIR}/TXFFmpeg.framework
TXFFmpeg_FRAMEWORK.path = /Contents/Frameworks
QMAKE_BUNDLE_DATA += TXFFmpeg_FRAMEWORK

# TXSoundTouch库的使用
LIBS += -F$$PWD/../SDK/TXSoundTouch.xcframework/macos-arm64_x86_64
LIBS += -framework TXSoundTouch
TXSoundTouch_FRAMEWORK.files = $$PWD/../SDK/TXSoundTouch.xcframework/macos-arm64_x86_64/TXSoundTouch.framework
# TXSoundTouch
LIBS += -F$${TXSOUNDTOUCHDIR} -framework TXSoundTouch
TXSoundTouch_FRAMEWORK.files = $${TXSOUNDTOUCHDIR}//TXSoundTouch.framework
TXSoundTouch_FRAMEWORK.path = /Contents/Frameworks
QMAKE_BUNDLE_DATA += TXSoundTouch_FRAMEWORK

# 运行时库路径rpath的添加
QMAKE_LFLAGS += -Wl -ObjC
QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks/

macx: LIBS += -L$$PWD/src/Util/mac/usersig/ -lTXLiteAVTestUserSig
macx: PRE_TARGETDEPS += $$PWD/src/Util/mac/usersig/libTXLiteAVTestUserSig.a
QMAKE_CXXFLAGS += -std=gnu++11
CONFIG += console

INCLUDEPATH += $$PWD/src/Util/mac/usersig/include
DEPENDPATH += $$PWD/src/Util/mac/usersig/include

DISTFILES += $$PWD/src/Util/mac/usersig/libTXLiteAVTestUserSig.a

SOURCES += \
$$PWD/src/Util/mac/cdnplayer/tx_liveplayer_proxy.mm

}


Expand Down
2 changes: 1 addition & 1 deletion Mac/QTDemo/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ You have [signed up for a Tencent Cloud account](https://intl.cloud.tencent.com/
>
>**macOS:** Download and install [Qt Creator](https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34%7C074ddad0-fdef-4e53-8aa8-5e8a876d6ab4), open `QTDemo.pro` with Qt Creator, paste the `SECRETKEY` and `SDKAppID` in `QTDemo/base/Defs.h`, and compile and run the demo.
>
> Note: Make sure you have [downloaded](https://liteav.sdk.qcloud.com/download/latest/TXLiteAVSDK_TRTC_Mac_latest.tar.bz2) and saved `TXLiteAVSDK_TRTC_Mac.framework` to the `Mac/SDK` folder. The downloaded package includes:
> Note: Make sure you have [downloaded](https://liteav.sdk.qcloud.com/download/latest/TXLiteAVSDK_TRTC_Mac_latest.tar.bz2) and saved `TXLiteAVSDK_TRTC_Mac.xcframework` to the `Mac/SDK` folder. The downloaded package includes:
>```
>├─ QTDemo // QT demo project
>├─ SDK // TRTC SDK for macOS
Expand Down
2 changes: 1 addition & 1 deletion Mac/QTDemo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
>
>**Mac:** 下载并安装 [Qt Creator](https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34%7C074ddad0-fdef-4e53-8aa8-5e8a876d6ab4),然后用 Qt Creator 打开 `QTDemo.pro` ,到 `QTDemo/base/Defs.h` 头文件中配置好对应的 `SECRETKEY``SDKAppID` 即可开始编译运行调试;
>
> `注意:`请您确保已将`TXLiteAVSDK_TRTC_Mac.framework`[下载](https://liteav.sdk.qcloud.com/download/latest/TXLiteAVSDK_TRTC_Mac_latest.tar.bz2)并保存到 `Mac/SDK` 文件夹下。最终的工程路径如下——
> `注意:`请您确保已将`TXLiteAVSDK_TRTC_Mac.xcframework`[下载](https://liteav.sdk.qcloud.com/download/latest/TXLiteAVSDK_TRTC_Mac_latest.tar.bz2)并保存到 `Mac/SDK` 文件夹下。最终的工程路径如下——
>```
>├─ QTDemo // QTDemo工程路径
>├─ SDK // TRTC MAC SDK
Expand Down

0 comments on commit af2d3dd

Please sign in to comment.