38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
From e279707a001c8f95f8a2bc51c0d19bf35bfc79ab Mon Sep 17 00:00:00 2001
|
|
From: Wan-Teh Chang <wtc@google.com>
|
|
Date: Fri, 11 Nov 2022 14:08:33 -0800
|
|
Subject: [PATCH] Build aviftest_helpers for are_images_equal.cc
|
|
|
|
If are_images_equal.cc is built, enable CXX and build the
|
|
aviftest_helpers library.
|
|
|
|
Fix the build failure when -DAVIF_BUILD_APPS=ON -DAVIF_BUILD_TESTS=ON
|
|
-DAVIF_ENABLE_GTEST=OFF is passed to the cmake command.
|
|
|
|
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
|
|
index 5af7ea560..632ba7a71 100644
|
|
--- a/tests/CMakeLists.txt
|
|
+++ b/tests/CMakeLists.txt
|
|
@@ -39,15 +39,17 @@ foreach(AVIFYUV_MODE limited rgb) # Modes drift and premultiply take more than 2
|
|
add_test(NAME avifyuv_${AVIFYUV_MODE} COMMAND avifyuv -m ${AVIFYUV_MODE})
|
|
endforeach()
|
|
|
|
-################################################################################
|
|
-# GoogleTest
|
|
-
|
|
-if(AVIF_ENABLE_GTEST)
|
|
+if(AVIF_ENABLE_GTEST OR AVIF_BUILD_APPS)
|
|
enable_language(CXX)
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
add_library(aviftest_helpers OBJECT gtest/aviftest_helpers.cc)
|
|
target_link_libraries(aviftest_helpers avif_apps)
|
|
+endif()
|
|
|
|
+################################################################################
|
|
+# GoogleTest
|
|
+
|
|
+if(AVIF_ENABLE_GTEST)
|
|
if(AVIF_LOCAL_GTEST)
|
|
set(GTEST_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/ext/googletest/googletest/include)
|
|
set(GTEST_LIBRARIES
|