Adjust scopes of avifincrtest_helpers dependencies
"gtest/gtest.h" is included by avifincrtest_helpers.cc but not by the
header avifincrtest_helpers.h, so move GTest::GTest to the PRIVATE
scope. Also move avif_enable_warnings to the PRIVATE scope.
Part 3 of the fix for
https://github.com/AOMediaCodec/libavif/issues/2340.
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index fa0f5ed..22ced3d 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -93,9 +93,11 @@
if(AVIF_ENABLE_GTEST)
check_avif_option(AVIF_GTEST TARGET GTest::GTest PKG_NAME GTest)
add_library(avifincrtest_helpers OBJECT gtest/avifincrtest_helpers.cc)
- target_link_libraries(avifincrtest_helpers avif GTest::GTest avif_enable_warnings)
+ target_link_libraries(avifincrtest_helpers PUBLIC avif)
+ target_link_libraries(avifincrtest_helpers PRIVATE GTest::GTest avif_enable_warnings)
add_library(avifincrtest_helpers_internal OBJECT gtest/avifincrtest_helpers.cc)
- target_link_libraries(avifincrtest_helpers_internal avif_internal GTest::GTest avif_enable_warnings)
+ target_link_libraries(avifincrtest_helpers_internal PUBLIC avif_internal)
+ target_link_libraries(avifincrtest_helpers_internal PRIVATE GTest::GTest avif_enable_warnings)
endif()
if(AVIF_ENABLE_GTEST)