Skip to content

Commit 963590e

Browse files
committed
Set core lib dependencies as PRIVATE???
1 parent 9573fc2 commit 963590e

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/torchcodec/_core/CMakeLists.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,21 @@ function(make_torchcodec_sublibrary
7171
)
7272
endif()
7373

74-
target_link_libraries(
75-
${library_name}
76-
PUBLIC
77-
${library_dependencies}
78-
)
74+
# For the core library, use PRIVATE to prevent FFmpeg dependencies from leaking
75+
# For other libraries, use PUBLIC so they can properly link to their dependencies
76+
if(${library_name} MATCHES ".*_core[0-9]+$")
77+
target_link_libraries(
78+
${library_name}
79+
PRIVATE
80+
${library_dependencies}
81+
)
82+
else()
83+
target_link_libraries(
84+
${library_name}
85+
PUBLIC
86+
${library_dependencies}
87+
)
88+
endif()
7989

8090
endfunction()
8191

0 commit comments

Comments
 (0)