@@ -10,8 +10,7 @@ find_package(Python3 ${PYTHON_VERSION} EXACT COMPONENTS Development)
1010function (make_torchcodec_sublibrary
1111 library_name
1212 sources
13- dependent_libraries
14- ffmpeg_include_dirs)
13+ library_dependencies)
1514
1615 add_library (${library_name} SHARED ${sources} )
1716 set_target_properties (${library_name} PROPERTIES CXX_STANDARD 17)
@@ -20,7 +19,6 @@ function(make_torchcodec_sublibrary
2019 ./../../../../
2120 "${TORCH_INSTALL_PREFIX} /include"
2221 ${Python3_INCLUDE_DIRS}
23- ${ffmpeg_include_dirs}
2422 )
2523
2624 # Avoid adding the "lib" prefix which we already add explicitly.
@@ -29,14 +27,15 @@ function(make_torchcodec_sublibrary
2927 target_link_libraries (
3028 ${library_name}
3129 PUBLIC
32- ${dependent_libraries }
30+ ${library_dependencies }
3331 )
3432endfunction ()
3533
3634function (make_torchcodec_libraries
3735 ffmpeg_major_version
38- ffmpeg_target
39- ffmpeg_include_dirs)
36+ ffmpeg_target)
37+
38+ # TODO: List each library and its purpose.
4039
4140 # Create libtorchcodec_decoderN.so
4241 set (decoder_library_name "libtorchcodec_decoder${ffmpeg_major_version} " )
@@ -52,14 +51,14 @@ function(make_torchcodec_libraries
5251 list (APPEND decoder_sources CPUOnlyDevice.cpp)
5352 endif ()
5453
55- set (decoder_dependent_libraries
54+ set (decoder_library_dependencies
5655 ${ffmpeg_target}
5756 ${TORCH_LIBRARIES}
5857 ${Python3_LIBRARIES}
5958 )
6059
6160 if (ENABLE_CUDA)
62- list (APPEND decoder_dependent_libraries
61+ list (APPEND decoder_library_dependencies
6362 ${CUDA_nppi_LIBRARY}
6463 ${CUDA_nppicc_LIBRARY}
6564 )
@@ -68,8 +67,7 @@ function(make_torchcodec_libraries
6867 make_torchcodec_sublibrary(
6968 "${decoder_library_name} "
7069 "${decoder_sources} "
71- "${decoder_dependent_libraries} "
72- "${ffmpeg_include_dirs} "
70+ "${decoder_library_dependencies} "
7371 )
7472
7573 # Create libtorchcodec_custom_opsN.so
@@ -82,7 +80,6 @@ function(make_torchcodec_libraries
8280 "${custom_ops_library_name} "
8381 "${custom_ops_sources} "
8482 "${decoder_library_name} "
85- "${ffmpeg_include_dirs} "
8683 )
8784
8885 # Create libtorchcodec_pybind_opsN.so
@@ -95,7 +92,6 @@ function(make_torchcodec_libraries
9592 "${pybind_ops_library_name} "
9693 "${pybind_ops_sources} "
9794 "${decoder_library_name} "
98- "${ffmpeg_include_dirs} "
9995 )
10096 # pybind11 quirk, see:
10197 # https://pybind11.readthedocs.io/en/stable/faq.html#someclass-declared-with-greater-visibility-than-the-type-of-its-field-someclass-member-wattributes
@@ -137,10 +133,10 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3})
137133 ${CMAKE_CURRENT_SOURCE_DIR} /fetch_and_expose_non_gpl_ffmpeg_libs.cmake
138134 )
139135
140- make_torchcodec_libraries(7 ffmpeg7 $ffmpeg7_INCLUDE_DIRs )
141- make_torchcodec_libraries(6 ffmpeg6 $ffmpeg6_INCLUDE_DIRS )
142- make_torchcodec_libraries(4 ffmpeg4 $ffmpeg4_INCLUDE_DIRS )
143- make_torchcodec_libraries(5 ffmpeg5 $ffmpeg5_INCLUDE_DIRS )
136+ make_torchcodec_libraries(7 ffmpeg7)
137+ make_torchcodec_libraries(6 ffmpeg6)
138+ make_torchcodec_libraries(4 ffmpeg4)
139+ make_torchcodec_libraries(5 ffmpeg5)
144140else ()
145141 message (
146142 STATUS
@@ -180,7 +176,7 @@ else()
180176 )
181177 endif ()
182178
183- make_torchcodec_libraries(${ffmpeg_major_version} PkgConfig::LIBAV ${LIBAV_INCLUDE_DIRS} )
179+ make_torchcodec_libraries(${ffmpeg_major_version} PkgConfig::LIBAV)
184180
185181 # Expose these values updwards so that the test compilation does not need
186182 # to re-figure it out. FIXME: it's not great that we just copy-paste the
0 commit comments