Skip to content

Commit

Permalink
Link aviftest/avifyuv with C++ compiler if libyuv
Browse files Browse the repository at this point in the history
libyuv is a C++ library. If libyuv is used, especially as a static
library, we need to link a C program such as aviftest.c and avifyuv.c
with libyuv using the C++ compiler.

This addresses the issue described in
google/oss-fuzz#713.
  • Loading branch information
wantehchang committed Feb 23, 2024
1 parent a44270e commit 51b6adf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ macro(register_test_for_coverage TEST_NAME)
endmacro()

add_executable(aviftest aviftest.c)
if(AVIF_CODEC_LIBGAV1_ENABLED)
if(AVIF_CODEC_LIBGAV1_ENABLED OR AVIF_LIBYUV_ENABLED)
set_target_properties(aviftest PROPERTIES LINKER_LANGUAGE "CXX")
endif()
target_link_libraries(aviftest avif)
add_test(NAME aviftest COMMAND aviftest ${CMAKE_CURRENT_SOURCE_DIR}/data)
register_test_for_coverage(aviftest ${CMAKE_CURRENT_SOURCE_DIR}/data/)

add_executable(avifyuv avifyuv.c)
if(AVIF_CODEC_LIBGAV1_ENABLED)
if(AVIF_CODEC_LIBGAV1_ENABLED OR AVIF_LIBYUV_ENABLED)
set_target_properties(avifyuv PROPERTIES LINKER_LANGUAGE "CXX")
endif()

Expand Down

0 comments on commit 51b6adf

Please sign in to comment.