File system-yuv.patch of Package libaom

Index: libaom-3.11.0/CMakeLists.txt
===================================================================
--- libaom-3.11.0.orig/CMakeLists.txt
+++ libaom-3.11.0/CMakeLists.txt
@@ -469,22 +469,14 @@ if(CONFIG_AV1_DECODER AND ENABLE_EXAMPLE
 endif()
 
 if(CONFIG_LIBYUV OR CONFIG_TUNE_BUTTERAUGLI)
-  add_library(yuv OBJECT ${AOM_LIBYUV_SOURCES})
-  if(NOT MSVC)
-    target_compile_options(yuv PRIVATE -Wno-shadow)
-    # Many functions in libyuv trigger this warning when enabled with gcc and
-    # clang.
-    is_flag_present(AOM_CXX_FLAGS "-Wmissing-declarations" flag_present)
-    if(flag_present)
-      target_compile_options(yuv PRIVATE -Wno-missing-declarations)
-    endif()
-    # Many functions in libyuv trigger this warning when enabled with clang.
-    is_flag_present(AOM_CXX_FLAGS "-Wmissing-prototypes" flag_present)
-    if(flag_present)
-      target_compile_options(yuv PRIVATE -Wno-missing-prototypes)
-    endif()
-  endif()
-  include_directories("${AOM_ROOT}/third_party/libyuv/include")
+  find_package(PkgConfig REQUIRED)
+  pkg_check_modules(libyuv REQUIRED libyuv)
+  add_library(system_libyuv INTERFACE)
+  target_link_libraries(system_libyuv INTERFACE ${libyuv_LIBRARIES})
+  target_link_directories(system_libyuv INTERFACE ${libyuv_LIBRARY_DIRS})
+  target_link_options(system_libyuv INTERFACE ${libyuv_LDFLAGS_OTHER})
+  target_include_directories(system_libyuv INTERFACE ${libyuv_INCLUDE_DIRS})
+  target_compile_options(system_libyuv INTERFACE ${libyuv_CFLAGS_OTHER})
 endif()
 
 if(CONFIG_AV1_ENCODER)
@@ -610,10 +602,10 @@ if(CONFIG_AV1_ENCODER)
       set_target_properties(aom_static PROPERTIES LINKER_LANGUAGE CXX)
     endif()
 
-    list(APPEND AOM_LIB_TARGETS yuv)
-    target_sources(aom PRIVATE $<TARGET_OBJECTS:yuv>)
+    list(APPEND AOM_LIB_TARGETS system_libyuv)
+    target_link_libraries(aom PRIVATE system_libyuv)
     if(BUILD_SHARED_LIBS)
-      target_sources(aom_static PRIVATE $<TARGET_OBJECTS:yuv>)
+      target_link_libraries(aom_static PRIVATE system_libyuv)
     endif()
   endif()
 
@@ -759,7 +751,7 @@ if(ENABLE_EXAMPLES OR ENABLE_TESTS OR EN
   if(CONFIG_LIBYUV)
     # Add to existing targets.
     foreach(aom_app ${AOM_APP_TARGETS})
-      target_sources(${aom_app} PRIVATE $<TARGET_OBJECTS:yuv>)
+      target_link_libraries(${aom_app} PRIVATE system_libyuv)
       set_property(TARGET ${aom_app} PROPERTY LINKER_LANGUAGE CXX)
     endforeach()
   endif()
Index: libaom-3.11.0/apps/aomdec.c
===================================================================
--- libaom-3.11.0.orig/apps/aomdec.c
+++ libaom-3.11.0/apps/aomdec.c
@@ -43,7 +43,7 @@
 #include "common/y4menc.h"
 
 #if CONFIG_LIBYUV
-#include "third_party/libyuv/include/libyuv/scale.h"
+#include <libyuv/scale.h>
 #endif
 
 static const char *exec_name;
Index: libaom-3.11.0/apps/aomenc.c
===================================================================
--- libaom-3.11.0.orig/apps/aomenc.c
+++ libaom-3.11.0/apps/aomenc.c
@@ -47,7 +47,7 @@
 #include "stats/rate_hist.h"
 
 #if CONFIG_LIBYUV
-#include "third_party/libyuv/include/libyuv/scale.h"
+#include <libyuv/scale.h>
 #endif
 
 /* Swallow warnings about unused results of fread/fwrite */
openSUSE Build Service is sponsored by