File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ option(ENABLE_STATIC "Build static library" OFF)
3737option (ENABLE_TESTS "Build unit tests" ON )
3838option (ENABLE_GIO "Support for gio file uris" OFF )
3939option (ENABLE_THUMBNAILER "Register ffmpegthumbnailer as thumbnailer" OFF )
40+ option (ENABLE_FULL_STATIC "Build fully static binary" OFF )
4041option (SANITIZE_ADDRESS "Build with address sanitizer (detect invalid memory access and memory leaks)" OFF )
4142
4243if (SANITIZE_ADDRESS)
Original file line number Diff line number Diff line change @@ -51,10 +51,7 @@ mark_as_advanced(
5151)
5252
5353# Determine if we need static linking
54- set (FFMPEG_USE_STATIC_LIBS OFF )
55- if (NOT BUILD_SHARED_LIBS OR ENABLE_STATIC)
56- set (FFMPEG_USE_STATIC_LIBS ON )
57- endif ()
54+ set (FFMPEG_USE_STATIC_LIBS ${ENABLE_FULL_STATIC} )
5855
5956message (STATUS "FFmpeg found: ${FFmpeg_FOUND} " )
6057message (STATUS " avcodec: ${AVCODEC_LIBRARY_PATH} " )
@@ -115,6 +112,11 @@ if(FFmpeg_FOUND AND NOT TARGET FFmpeg::avcodec)
115112 INTERFACE_LINK_DIRECTORIES "${AVCODEC_STATIC_LIBRARY_DIRS} " )
116113 set_property (TARGET FFmpeg::avcodec APPEND PROPERTY
117114 INTERFACE_LINK_LIBRARIES "${AVCODEC_STATIC_LIBRARIES} " )
115+
116+ if (APPLE )
117+ set_property (TARGET FFmpeg::avcodec APPEND PROPERTY
118+ INTERFACE_LINK_LIBRARIES "-framework CoreVideo" "-framework VideoToolbox" )
119+ endif ()
118120 endif ()
119121endif ()
120122
Original file line number Diff line number Diff line change 169169 ++ pkgsForHost . lib . optionals ( isStatic && ! isWindows && pkgsForHost . stdenv . isLinux ) [
170170 "-DCMAKE_EXE_LINKER_FLAGS=-static"
171171 ]
172- ++ pkgsForHost . lib . optionals ( isStatic && pkgsForHost . stdenv . isDarwin ) [
173- "-DCMAKE_EXE_LINKER_FLAGS=-framework CoreVideo;-framework VideoToolbox "
172+ ++ pkgsForHost . lib . optionals isStatic [
173+ "-DENABLE_FULL_STATIC=ON "
174174 ]
175175 ++ pkgsForHost . lib . optionals ( pkgsForHost . stdenv . isLinux && ! isStatic && ! isWindows ) [
176176 "-DENABLE_GIO=ON"
You can’t perform that action at this time.
0 commit comments