From 1f86eb63b18d7bef9b91008b1b373f7628571608 Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Wed, 31 Jul 2024 09:25:49 -0700 Subject: [PATCH] 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. --- tests/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fa0f5ed367..22ced3db7e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -93,9 +93,11 @@ endmacro() 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)