Commit e2944b0aa1 for aom
commit e2944b0aa11fa43a6ae820c9d03e44098ccad46c
Author: Wan-Teh Chang <wtc@google.com>
Date: Thu Jun 18 11:11:52 2026 -0700
aom shared lib should only have PRIVATE link libs
The aom shared library should only link with the m and Threads::Threads
libraries in PRIVATE scope so that the library dependencies do not
become part of the link interface.
Bug: 525452409
Change-Id: I2d20dd1d75f7184556d3bb1768a55f0044e9bf4d
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4a26d0ac3..b335d079a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -360,9 +360,11 @@ if(BUILD_SHARED_LIBS)
endif()
if(NOT WIN32 AND NOT APPLE)
- target_link_libraries(aom ${AOM_LIB_LINK_TYPE} m)
if(BUILD_SHARED_LIBS)
+ target_link_libraries(aom PRIVATE m)
target_link_libraries(aom_static ${AOM_LIB_LINK_TYPE} m)
+ else()
+ target_link_libraries(aom ${AOM_LIB_LINK_TYPE} m)
endif()
endif()
@@ -856,9 +858,11 @@ endif()
if(HAVE_PTHREAD_H AND CONFIG_MULTITHREAD)
find_package(Threads)
- target_link_libraries(aom ${AOM_LIB_LINK_TYPE} Threads::Threads)
if(BUILD_SHARED_LIBS)
+ target_link_libraries(aom PRIVATE Threads::Threads)
target_link_libraries(aom_static ${AOM_LIB_LINK_TYPE} Threads::Threads)
+ else()
+ target_link_libraries(aom ${AOM_LIB_LINK_TYPE} Threads::Threads)
endif()
endif()