Skip to content

Commit

Permalink
Fix mac ffmpeg version check
Browse files Browse the repository at this point in the history
  • Loading branch information
taoboyang authored and sfeiwong committed Dec 14, 2023
1 parent 9847ffe commit e3c9730
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ jobs:
echo "ENV PATH=\${PATH}:/opt/python/cp39-cp39/bin" >>${tmp_file}
echo "ENV LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/opt/python/cp39-cp39/lib" >>${tmp_file}
echo "ENV GITHUB_ACTIONS=${GITHUB_ACTIONS}" >>${tmp_file}
if [ "${{ matrix.device }}" == "gpu" ]; then
echo "ENV CUDA_PATH=/usr/local/cuda" >>${tmp_file}
fi
docker build -t bmf_build:tmp -f ${tmp_file} .
rm -rf ${tmp_file}
docker run --rm -v $(pwd):/root/bmf -w /root/bmf bmf_build:tmp bash -c "./scripts/build_ffmpeg.sh --device=${{ matrix.device }} && git config --global --add safe.directory /root/bmf && ./build.sh"
Expand Down
1 change: 0 additions & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ if(BMF_ENABLE_FFMPEG)
set(BMF_FFMPEG_TARGETS
ffmpeg::avcodec ffmpeg::avformat ffmpeg::avfilter
ffmpeg::avdevice ffmpeg::avutil ffmpeg::swscale ffmpeg::swresample)
add_definitions(-DBMF_FFMPEG_VERSION=${BMF_FFMPEG_VERSION})
else()
set(BMF_FFMPEG_TARGETS)
message(WARNING "FFMPEG libraries not found, disable it")
Expand Down
6 changes: 5 additions & 1 deletion cmake/ffmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ if(FFMPEG_LIBRARY_DIR AND FFMPEG_INCLUDE_DIR)

if(TARGET ffmpeg::avcodec)
find_ffmpeg_version(${FFMPEG_INCLUDE_DIR}/libavutil BMF_FFMPEG_VERSION)
add_definitions(-DBMF_FFMPEG_VERSION=${BMF_FFMPEG_VERSION})
set(FFMPEG_FOUND TRUE)
else()
set(FFMPEG_FOUND FALSE)
Expand All @@ -93,6 +94,10 @@ else()
set_property(TARGET ffmpeg::${ARGV0} PROPERTY INTERFACE_LINK_LIBRARIES
${LIBRARY_LINK_LIBRARIES})
unset(LIBRARY CACHE)
if("${ARGV0}" STREQUAL "avutil")
find_ffmpeg_version(${LIBRARY_INCLUDE_DIRS}/libavutil BMF_FFMPEG_VERSION)
add_definitions(-DBMF_FFMPEG_VERSION=${BMF_FFMPEG_VERSION})
endif()
endif()
endfunction()

Expand All @@ -106,7 +111,6 @@ else()
define_ffmpeg_target(swresample)

if(TARGET ffmpeg::avcodec)
find_ffmpeg_version(${FFMPEG_INCLUDE_DIR}/libavutil BMF_FFMPEG_VERSION)
set(FFMPEG_FOUND TRUE)
else()
set(FFMPEG_FOUND FALSE)
Expand Down

0 comments on commit e3c9730

Please sign in to comment.