mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-11-16 09:11:12 +00:00
Stop FFmpeg libs preceding ccx_rust on the link line (#2357)
libccx.a propagated its FFmpeg libraries through INTERFACE_LINK_LIBRARIES, so on a plain -DWITH_FFMPEG=ON build they landed on the link line before rust/libccx_rust.a and GNU ld dropped them, leaving undefined avfilter/swscale symbols. Clear that propagation and drop the duplicate EXTRA_FFMPEG_LIBS append in the WITH_HARDSUBX block (WITH_HARDSUBX already forces WITH_FFMPEG). Plain, OCR and hardsubx builds link the same libraries as before; -DWITH_FFMPEG=ON now links.
This commit is contained in:
committed by
GitHub
parent
fe00722960
commit
a5ffd09305
@@ -175,6 +175,12 @@ if (NETWORKING_DEBUG)
|
||||
endif (NETWORKING_DEBUG)
|
||||
add_subdirectory (lib_ccx)
|
||||
|
||||
# ccx is STATIC, so CMake propagates its PRIVATE link libraries to consumers as
|
||||
# $<LINK_ONLY:...>, pinning the FFmpeg libs before rust/libccx_rust.a. GNU ld
|
||||
# resolves left to right, so rsmpeg's FFmpeg symbols would already be discarded.
|
||||
# This file lists every dependency explicitly and owns the order (EXTRA_FFMPEG_LIBS).
|
||||
set_property (TARGET ccx PROPERTY INTERFACE_LINK_LIBRARIES "")
|
||||
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR} SOURCEFILE)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ccx)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${GPAC_LIBRARIES})
|
||||
@@ -271,11 +277,6 @@ if (PKG_CONFIG_FOUND AND WITH_HARDSUBX)
|
||||
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${TESSERACT_INCLUDE_DIRS})
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${LEPTONICA_INCLUDE_DIRS})
|
||||
|
||||
# Collect FFmpeg libs for placement after ccx_rust (same reason as WITH_FFMPEG)
|
||||
set (EXTRA_FFMPEG_LIBS ${EXTRA_FFMPEG_LIBS} ${AVFORMAT_LIBRARIES}
|
||||
${AVUTIL_LIBRARIES} ${AVCODEC_LIBRARIES} ${AVFILTER_LIBRARIES}
|
||||
${SWSCALE_LIBRARIES})
|
||||
endif (PKG_CONFIG_FOUND AND WITH_HARDSUBX)
|
||||
|
||||
add_executable (ccextractor ${SOURCEFILE} ${FREETYPE_SOURCE} ${UTF8PROC_SOURCE})
|
||||
|
||||
@@ -60,9 +60,9 @@ endif (WITH_OCR)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/lib_ccx/" SOURCEFILE)
|
||||
|
||||
add_library (ccx ${SOURCEFILE} ccx_dtvcc.h ccx_dtvcc.c ccx_encoders_mcc.c ccx_encoders_mcc.h)
|
||||
# PRIVATE prevents transitive propagation to consumers (ccextractor).
|
||||
# The parent CMakeLists.txt adds all needed libs explicitly, controlling
|
||||
# link order so FFmpeg libs appear after ccx_rust (required by GNU ld).
|
||||
# PRIVATE does not stop propagation here: ccx is STATIC, so CMake still records
|
||||
# these in INTERFACE_LINK_LIBRARIES as $<LINK_ONLY:...>. The parent clears that
|
||||
# and owns the link order (FFmpeg must follow ccx_rust for GNU ld).
|
||||
target_link_libraries (ccx PRIVATE ${EXTRA_LIBS})
|
||||
target_include_directories (ccx PUBLIC ${EXTRA_INCLUDES})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user