Skip to content
Snippets Groups Projects
Commit 730b00bd authored by Maxim Cournoyer's avatar Maxim Cournoyer Committed by Amin Bandali
Browse files

libclient: Explicitly link to avutil when using libwrap.


Otherwise, when libjami is compiled as a shared library and
dynamically linked with all its dependencies (including ffmpeg), the
build would fail with:

  ld: src/libclient/liblibjamiclient.a(directrenderer.cpp.o):
  undefined reference to symbol 'av_frame_alloc@@LIBAVUTIL_56'
  ld: /gnu/store/...-ffmpeg-jami-4.4.2/lib/libavutil.so.56:
  error adding symbols: DSO missing from command line

* src/libclient/CMakeLists.txt: Call find_library for avutil, with
hints for contrib path on GNU/Linux and macOS.
[ENABLE_LIBWRAP]: Add target link to avutil if not on Windows.

Co-authored-by: default avatarKateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
Co-authored-by: default avatarAmin Bandali <amin.bandali@savoirfairelinux.com>
Change-Id: Id9681132b046fd828002cd3daa24afc8a6dd1eae
parent 15e13330
Branches
Tags
No related merge requests found
......@@ -329,6 +329,10 @@ find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h
${LIBJAMI_CONTRIB_DIR}/native/ffmpeg
${LIBJAMI_CONTRIB_DIR}/build/ffmpeg/Build/win32/x64/include)
include_directories(${AVUTIL_INCLUDE_DIR})
find_library(AVUTIL_LIBRARY avutil
HINTS
${LIBJAMI_CONTRIB_DIR}/native/ffmpeg
${LIBJAMI_CONTRIB_DIR}/x86_64-apple-darwin${CMAKE_HOST_SYSTEM_VERSION}/lib)
if(ENABLE_LIBWRAP)
list(APPEND LIBCLIENT_HEADERS directrenderer.h)
......@@ -465,6 +469,9 @@ foreach(QT_LIB ${QT_LIBS})
endforeach()
if(ENABLE_LIBWRAP)
target_link_libraries(${LIBCLIENT_NAME} qtwrapper ${LIBJAMI_LIB})
if (NOT (CMAKE_CXX_COMPILER_ID MATCHES "MSVC"))
target_link_libraries(${LIBCLIENT_NAME} ${AVUTIL_LIBRARY})
endif()
endif()
if (NOT (CMAKE_CXX_COMPILER_ID MATCHES "MSVC"))
target_link_libraries(${LIBCLIENT_NAME} -lpthread)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment