From 9a9d99fb57caa38c4bc045f544429ec919ec6158 Mon Sep 17 00:00:00 2001
From: Gyorgy Sarvari <skandigraun@gmail.com>
Date: Mon, 26 Jan 2026 21:26:49 +0100
Subject: [PATCH] don't look for iconv.h for native build

iconv.h is not installed in the sysroot for native builds, and cmake
only searches for it in the sysroot.

It seems to be only required for zlib-ng support (based on the
commit[1] that introduced this dependency), which is currently not
enabled in the recipe.

To avoid build failure due to not finding this header during configuration,
remove this dependency from native builds

Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 cmake/modules/FindLibXml2.cmake | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/cmake/modules/FindLibXml2.cmake b/cmake/modules/FindLibXml2.cmake
index d36b390..f3e4762 100644
--- a/cmake/modules/FindLibXml2.cmake
+++ b/cmake/modules/FindLibXml2.cmake
@@ -66,11 +66,6 @@ find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
    PATH_SUFFIXES libxml2
    )
 
-find_path(ICONV_INCLUDE_DIR  NAMES iconv.h
-   HINTS
-   ${LIBXML2_HINTS}/include
-   )
-
 # CMake 3.9 and below used 'LIBXML2_LIBRARIES' as the name of
 # the cache entry storing the find_library result.  Use the
 # value if it was set by the project or user.
@@ -103,7 +98,7 @@ elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.
     unset(libxml2_version_str)
 endif()
 
-set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR} ${PC_LIBXML_INCLUDE_DIRS} ${ICONV_INCLUDE_DIR})
+set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR} ${PC_LIBXML_INCLUDE_DIRS})
 set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
 
 include(FindPackageHandleStandardArgs)
