fix: linux build error

This commit is contained in:
Barry 2022-06-06 18:35:30 +08:00
parent a5fe25767a
commit 1cc2c7d2c8
2 changed files with 12 additions and 9 deletions

View file

@ -280,6 +280,18 @@ endif()
# Linux
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(QSC_DEPLOY_PATH "")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE
# qx11
Qt${QT_VERSION_MAJOR}::X11Extras
# xcb https://doc.qt.io/qt-5/linux-requirements.html
xcb
# pthread
Threads::Threads
)
# linux set app icon: https://blog.csdn.net/MrNoboday/article/details/82870853
endif()

View file

@ -199,9 +199,6 @@ endif()
# Linux
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# include
target_include_directories(${QSC_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/ffmpeg/include)
# link
@ -213,12 +210,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
avcodec
avutil
swscale
# qx11
Qt${QT_VERSION_MAJOR}::X11Extras
# xcb https://doc.qt.io/qt-5/linux-requirements.html
xcb
# pthread
Threads::Threads
)
endif()