diff options
author | Piotr Srebrny <piotr.srebrny@qt.io> | 2022-05-05 13:41:36 +0200 |
---|---|---|
committer | Piotr Srebrny <piotr.srebrny@qt.io> | 2022-05-05 16:10:09 +0200 |
commit | 63332432a4ba12d649e52f32b668f70c500ab17b (patch) | |
tree | ebb6e2253553067143c9d1d74a0623e868f7b0c0 /cmake | |
parent | 2a0cdd8aa2b1c738f3c842e99afa12cabd0077c5 (diff) |
Hide symbols for all ffmpeg components to avoid relocation problem
The recent changes in qtmultimedia code led to problems when resolving
symbol relocations for statically linked swscale library. This patch
applies --exclude-libs flag to all FFmpeg library components to avoid
this problem in the future with other library components.
Change-Id: I712432d95f0e638ac09feb1656f84d986d3fc534
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindFFmpeg.cmake | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cmake/FindFFmpeg.cmake b/cmake/FindFFmpeg.cmake index d48f1072a..bb7cf1ea9 100644 --- a/cmake/FindFFmpeg.cmake +++ b/cmake/FindFFmpeg.cmake @@ -225,6 +225,9 @@ endfunction() ) __ffmpeg_internal_set_dependencies(${_lowerComponent}) target_link_libraries(FFmpeg::${_lowerComponent} INTERFACE "${${_component}_LIBRARY}") + if (UNIX AND NOT APPLE) + target_link_options(FFmpeg::${_lowerComponent} INTERFACE "-Wl,--exclude-libs=lib${_lowerComponent}") + endif () endif() else() # message(STATUS "Required component ${_component} missing.") @@ -259,10 +262,6 @@ if (NOT TARGET FFmpeg::FFmpeg) add_library(FFmpeg::FFmpeg ALIAS FFmpeg) endif() -if (TARGET FFmpeg::avcodec AND UNIX AND NOT APPLE) - target_link_options(FFmpeg::avcodec INTERFACE "-Wl,--exclude-libs=libavcodec") -endif () - # Now set the noncached _FOUND vars for the components. foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE) set_component_found(${_component}) |